I have not seen the SAML implementation for Go, but you can use a server that already implements it in front of your application.
One of the best supported SAML implementations is Shibboleth . The apache module is the most mature and probably the easiest method to use, since you just put your application behind a reverse proxy in apache. There is also a fastcgi authenticator that uses the same backend, but I cannot talk about its ease of implementation.
If you just need a service provider, the easiest SAML binding is HTTP-POST-SimpleSign. I made a proof of conceptual implementation in python to try to demonstrate the simplest SP I could do. I do not claim to be reliable this module, but you can see that this can be done with not too much code. This assumes that the Identity providers you work with support this binding. And, as always, be careful when deploying any custom security-related code.
source share