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 DefaultAuthValidityTime + const DefaultCodeValidityTime + type Authorization struct + ACR string + AMR []string + Scopes []string + type AuthorizationRequest struct + ACRValues []string + ClientID string + Scopes []string + SessionID string + type ClientSource interface + IsUnauthenticatedClient func(clientID string) (ok bool, err error) + IsValidClientID func(clientID string) (ok bool, err error) + ValidateClientRedirectURI func(clientID, redirectURI string) (ok bool, err error) + ValidateClientSecret func(clientID, clientSecret string) (ok bool, err error) + type Config struct + AuthValidityTime time.Duration + CodeValidityTime time.Duration + type GrantType string + const GrantTypeAuthorizationCode + const GrantTypeRefreshToken + type OIDC struct + func New(cfg *Config, smgr SessionManager, clientSource ClientSource, signer Signer) (*OIDC, error) + func (o *OIDC) FinishAuthorization(w http.ResponseWriter, req *http.Request, sessionID string, ...) error + func (o *OIDC) StartAuthorization(w http.ResponseWriter, req *http.Request) (*AuthorizationRequest, error) + func (o *OIDC) Token(w http.ResponseWriter, req *http.Request, ...) error + func (o *OIDC) Userinfo(w http.ResponseWriter, req *http.Request, ...) error + type Session interface + Expiry func() time.Time + ID func() string + type SessionManager interface + DeleteSession func(ctx context.Context, sessionID string) error + GetSession func(ctx context.Context, sessionID string, into Session) (found bool, err error) + NewID func() string + PutSession func(context.Context, Session) error + type Signer interface + Sign func(ctx context.Context, data []byte) (signed []byte, err error) + SignerAlg func(ctx context.Context) (jose.SignatureAlgorithm, error) + VerifySignature func(ctx context.Context, jwt string) (payload []byte, err error) + type TokenRequest struct + AuthTime time.Time + Authorization Authorization + ClientID string + GrantType GrantType + IsRefresh bool + Nonce string + SessionID string + SessionRefreshable bool + func (t *TokenRequest) PrefillIDToken(iss, sub string, expires time.Time) oidc.Claims + type TokenResponse struct + AccessTokenValidUntil time.Time + IDToken oidc.Claims + IssueRefreshToken bool + RefreshTokenValidUntil time.Time + type UserinfoRequest struct + SessionID string