Versions in this module Expand all Collapse all v1 v1.0.1 Mar 21, 2024 v1.0.0 Dec 11, 2023 Changes in this version + const ScopeOfflineAccess + type Audience []string + func (a *Audience) UnmarshalJSON(b []byte) error + func (a Audience) Contains(aud string) bool + func (a Audience) MarshalJSON() ([]byte, error) + type AuthCodeOption func(*authCodeCfg) + func AddScopes(scopes []string) AuthCodeOption + func SetNonce(nonce string) AuthCodeOption + type Claims struct + ACR string + AMR []string + AZP string + Audience Audience + AuthTime UnixTime + Expiry UnixTime + Extra map[string]interface{} + IssuedAt UnixTime + Issuer string + Nonce string + NotBefore UnixTime + Subject string + func (c *Claims) Unmarshal(into interface{}) error + func (c *Claims) UnmarshalJSON(b []byte) error + func (c Claims) MarshalJSON() ([]byte, error) + func (c Claims) String() string + type Client struct + func DiscoverClient(ctx context.Context, issuer, clientID, clientSecret, redirectURL string, ...) (*Client, error) + func NewClient(md *discovery.ProviderMetadata, ks KeySource, ...) *Client + func (c *Client) AuthCodeURL(state string, opts ...AuthCodeOption) string + func (c *Client) Exchange(ctx context.Context, code string) (*Token, error) + func (c *Client) SetClientSecret(secret string) + func (c *Client) SetRedirectURL(redirectURL string) + func (c *Client) TokenSource(ctx context.Context, t *Token) TokenSource + func (c *Client) Userinfo(ctx context.Context, token *Token) (*Userinfo, error) + type ClientOpt func(*Client) + func WithACRValues(acrValues []string, enforce bool) ClientOpt + func WithAdditionalScopes(scopes []string) ClientOpt + type HTTPError struct + Body []byte + Cause error + Response *http.Response + func (h *HTTPError) Error() string + func (h *HTTPError) Unwrap() error + type KeySource interface + GetKey func(ctx context.Context, kid string) (*jose.JSONWebKey, error) + type StaticKeysource struct + func NewStaticKeysource(keys jose.JSONWebKeySet) *StaticKeysource + func (s *StaticKeysource) GetKey(_ context.Context, kid string) (*jose.JSONWebKey, error) + type Token struct + AccessToken string + Claims Claims + Expiry time.Time + IDToken string + RefreshToken string + func (t *Token) Type() string + func (t *Token) Valid() bool + type TokenSource interface + Token func(ctx context.Context) (*Token, error) + type Transport struct + Base http.RoundTripper + func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) + type UnixTime int64 + func NewUnixTime(t time.Time) UnixTime + func (u *UnixTime) UnmarshalJSON(b []byte) error + func (u UnixTime) MarshalJSON() ([]byte, error) + func (u UnixTime) Time() time.Time + type Userinfo struct + Claims Claims + Token *Token + type Verifier struct + func DiscoverVerifier(ctx context.Context, issuer string) (*Verifier, error) + func NewVerifier(issuer string, keySource KeySource) *Verifier + func (v *Verifier) VerifyRaw(ctx context.Context, audience string, raw string, opts ...VerifyOpt) (*Claims, error) + type VerifyOpt func(v *verifyCfg)