OpenID Connect client for Go's golang.org/x/oauth2
open sourceApache-2.0free
go-oidc adds OpenID Connect support to Go's golang.org/x/oauth2 package. It sets up a provider through OpenID Connect discovery from the issuer URL, gives the OAuth 2.0 endpoints to an oauth2.Config, and verifies the ID token (a signed JWT) that comes back, so a program can read the user's standard claims such as subject, email and name. It works with consumer, enterprise and workload identity providers, from Google, Apple and Microsoft Entra ID to Okta, Auth0, GitHub Actions and Kubernetes service account tokens.
Problems it solves
- add Sign in with Google or Okta to my Go web app
- verify an OpenID Connect ID token in a Go service
- check a GitHub Actions OIDC token in my Go server
Features
- provider set-up through OpenID Connect discovery
- ID token verification
- standard and custom claims extraction
- works with golang.org/x/oauth2 configs and redirects
- workload identity tokens (GitHub Actions, GitLab CI, Kubernetes)
