Documentation
¶
Index ¶
- func GenerateState() (string, error)
- type Claims
- type Config
- type DiscoveryDocument
- type HTTPClient
- type Provider
- func (p *Provider) AuthorizationURL(ctx context.Context, state string) (string, error)
- func (p *Provider) CallbackHandler(...) http.HandlerFunc
- func (p *Provider) Config() Config
- func (p *Provider) Discover(ctx context.Context) (*DiscoveryDocument, error)
- func (p *Provider) ExchangeCode(ctx context.Context, code string) (*TokenResponse, error)
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateState ¶
GenerateState produces a cryptographically random state parameter.
Types ¶
type Claims ¶
type Claims struct {
Subject string `json:"sub"`
Email string `json:"email"`
EmailVerified bool `json:"email_verified"`
Name string `json:"name"`
Groups []string `json:"groups,omitempty"`
Issuer string `json:"iss"`
Audience string `json:"aud"`
ExpiresAt int64 `json:"exp"`
IssuedAt int64 `json:"iat"`
}
Claims represents the standard claims extracted from an ID token.
func ParseIDTokenUnverified ¶
ParseIDTokenUnverified extracts claims from an ID token without cryptographic verification. Use this only when you have already validated the token via the token endpoint response.
type Config ¶
type Config struct {
Issuer string `json:"issuer" yaml:"issuer"`
ClientID string `json:"client_id" yaml:"client_id"`
ClientSecret string `json:"client_secret" yaml:"client_secret"` //nolint:gosec // G117: OIDC config field
RedirectURI string `json:"redirect_uri" yaml:"redirect_uri"`
Scopes []string `json:"scopes" yaml:"scopes"`
}
Config holds OIDC provider configuration.