There’s a Discourse SAML plugin already, which if you’re self-hosting you can just drop right in. Be warned, though, that SAML itself, and the various implementations thereof, are a complete and utter trash fire, and you’ll likely need to do a certain amount of debugging to get it working right. I don’t think we’ve had an Enterprise customer SAML roll out that hasn’t needed some degree of fiddling to get working.