Versions in this module Expand all Collapse all v0 v0.6.0 Jan 4, 2021 Changes in this version type Authentication + IdpId string v0.5.0 Jan 4, 2021 Changes in this version type SelectAccountCallback + SelectedId string v0.4.0 Jan 2, 2021 Changes in this version + type Stub interface + ConsentCallback func(ctx context.Context, xid string, callback *ConsentCallback) (bool, error) + ConsentState func(ctx context.Context, xid string) (*InteractionState, error) + LoginCallback func(ctx context.Context, xid string, callback *LoginCallback) (bool, error) + LoginState func(ctx context.Context, xid string) (*InteractionState, error) + ResumeAuthorize func(rw http.ResponseWriter, r *http.Request, xid string) + SelectAccountCallback func(ctx context.Context, xid string, callback *SelectAccountCallback) (bool, error) + SelectAccountState func(ctx context.Context, xid string) (*InteractionState, error) + TokenByClientCredentials func(ctx context.Context, scopes []string) (*TokenResponse, error) + TokenByCode func(ctx context.Context, code string, redirectURI string, scopes []string) (*TokenResponse, error) + TokenByRefreshToken func(ctx context.Context, refreshToken string, scopes []string) (*TokenResponse, error) v0.3.0 Dec 31, 2020 Changes in this version type InteractionCallback + Nonce string v0.2.0 Dec 29, 2020 Changes in this version type TokenResponse + Scope string v0.1.0 Dec 22, 2020 Changes in this version + const AccessTokenType + const DefaultServiceBaseURL + var DefaultHTTPClient = &http.Client + var ErrAccessTokenNotSet = errors.New("access token not set on context") + var ErrContextTooLarge = errors.New("context data exceeds discovery limit") + var ErrInsufficientScope = errors.New("insufficient scope") + var ErrInvalidAccessToken = errors.New("access token is invalid") + var ErrMalformedAuthHeader = errors.New("authorization header is malformed") + var ErrUnexpectedResponse = errors.New("sdk received unexpected response") + var WithClientJwks = func(clientJwks *jwx.KeySet) Option + var WithClientSecretBasic = func(clientId string, clientSecret string) Option + var WithClientSecretPost = func(clientId string, clientSecret string) Option + var WithHTTPClient = func(httpClient *http.Client) Option + var WithPrivateKeyJwt = func(clientId string, clientJwks *jwx.KeySet, signingAlg string) Option + var WithServiceBaseURL = func(url string) Option + func Protect(discovery *oidc.Discovery, jwks *jwx.KeySet, opt *ProtectOpt) func(http.Handler) http.Handler + type AccessToken struct + ClientId string + ExpiresIn int64 + Scopes []string + Type string + UserInfoClaims map[string]interface{} + Value string + func GetAccessToken(ctx context.Context) (*AccessToken, error) + type AccessTokenClaims struct + Client string + Scope string + UserInfo map[string]interface{} + func (c *AccessTokenClaims) Get(name string) (interface{}, bool) + type Authentication struct + AuthTime int64 + Context json.RawMessage + Subject string + type Client struct + ClientURI string + Contacts []string + LogoURI string + Name string + PolicyURI string + TermsOfServiceURI string + type ConsentCallback struct + Ephemeral bool + GrantedScopes []string + RejectedScopes []string + type ErrorResponse struct + Code string + Reason string + Status int + func (r *ErrorResponse) Error() string + type InteractionCallback struct + Error string + ErrorDescription string + Success bool + Timestamp int64 + type InteractionState struct + Authentications map[string]*Authentication + Client *Client + OIDC *OIDC + Scopes map[string]ScopeData + Subject string + type LoginCallback struct + Acr string + Amr []string + Context json.RawMessage + Remember int64 + Subject string + type OIDC struct + AcrValues string + Display string + LoginHint string + UILocales string + type Option func(sdk *SDK) + type ProtectOpt struct + Audience []string + Leeway time.Duration + RenderError func(http.ResponseWriter, *http.Request, error) + Scopes []string + Subject string + type SDK struct + func New(options ...Option) *SDK + func (s *SDK) ConsentCallback(ctx context.Context, challenge string, callback *ConsentCallback) (bool, error) + func (s *SDK) ConsentState(ctx context.Context, challenge string) (*InteractionState, error) + func (s *SDK) Discovery() *oidc.Discovery + func (s *SDK) LoginCallback(ctx context.Context, challenge string, callback *LoginCallback) (bool, error) + func (s *SDK) LoginState(ctx context.Context, challenge string) (*InteractionState, error) + func (s *SDK) Protect(opt *ProtectOpt) func(http.Handler) http.Handler + func (s *SDK) ResumeAuthorize(rw http.ResponseWriter, r *http.Request, challenge string) + func (s *SDK) SelectAccountCallback(ctx context.Context, challenge string, callback *SelectAccountCallback) (bool, error) + func (s *SDK) SelectAccountState(ctx context.Context, challenge string) (*InteractionState, error) + func (s *SDK) TokenByClientCredentials(ctx context.Context, scopes []string) (*TokenResponse, error) + func (s *SDK) TokenByCode(ctx context.Context, code string, redirectURI string, scopes []string) (*TokenResponse, error) + func (s *SDK) TokenByRefreshToken(ctx context.Context, refreshToken string, scopes []string) (*TokenResponse, error) + type ScopeData struct + Detail json.RawMessage + Status string + type SelectAccountCallback struct + Subject string + type TokenResponse struct + AccessToken string + ExpiresIn *int64 + IdToken string + RefreshToken string + TokenType string