A Go OpenID Connect client.
OpenID Connect is a specification on top of OAuth 2.0 that adds a provider-agnostic API for user attributes. End users perform the regular OAuth 2.0 flow and the response includes a JWT signed by the identity provider with standard claims for a stable identifier, email, display name, and other attributes.
{
"sub": "12345abcd",
"email": "[email protected]",
"email_verified": true,
"name": "Jane Doe"
}This package can be used to identify users (and even workload identities) across a large number of identity providers:
go-oidc is a mature OpenID Connect client, and is imported by over 1000 open source projects.
This package enables OpenID Connect support for the golang.org/x/oauth2 package.
The client can be initialized through OpenID Connect discovery with the issuer
URL and a few additional scopes on the oauth2.Config.
…OAuth2 redirects are unchanged.
func handleRedirect(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, oauth2Config.AuthCodeURL(state), http.StatusFound)
}Then, on the response, the ID Token verifier can be used to verify ID Tokens.
…No open issues yet, or sync has not completed.