Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClientAuthenticationFailed = errors.New(errors.KindUnauthorizedClient, "client authentication failed") ErrClientIDMismatch = errors.New(errors.KindInvalidClient, "client ID mismatch") ErrInsufficientScopes = errors.New(errors.KindInvalidGrant, "insufficient scopes") ErrMalformedRequest = errors.New(errors.KindInvalidRequest, "malformed request") ErrMissingParameter = errors.New(errors.KindInvalidRequest, "missing parameter") ErrRedirectURIMismatch = errors.New(errors.KindInvalidGrant, "redirect URI mismatch") ErrUnsupportedGrantType = errors.New(errors.KindUnsupportedGrantType, "unsupported grant type") )
Functions ¶
This section is empty.
Types ¶
type Authorization ¶
type AuthorizationCodeGrantRequest ¶
type AuthorizationCodeGrantRequest struct { Request Code string `form:"code"` RedirectURI *string `form:"redirect_uri,omitempty"` pkce.Verifier }
func (*AuthorizationCodeGrantRequest) Type ¶
func (r *AuthorizationCodeGrantRequest) Type() oauth2.GrantType
func (*AuthorizationCodeGrantRequest) Validate ¶
func (r *AuthorizationCodeGrantRequest) Validate(redirectURI *string, challenge pkce.Challenge) error
Validate validates the AuthorizationCodeGrantRequest against the previously requested redirectURI and optionally PKCE challenge. If the redirectURI does not match AuthorizationCodeGrantRequest.RedirectURI, returns ErrRedirectURIMismatch.
type GrantRequest ¶
func ReadRequest ¶
func ReadRequest(r *http.Request) (GrantRequest, error)
type RefreshTokenGrantRequest ¶
type RefreshTokenGrantRequest struct { Request RefreshToken string `form:"refresh_token"` Scope *string `form:"scope,omitempty"` }
func (*RefreshTokenGrantRequest) Scopes ¶
func (r *RefreshTokenGrantRequest) Scopes() []string
func (*RefreshTokenGrantRequest) Type ¶
func (r *RefreshTokenGrantRequest) Type() oauth2.GrantType
func (*RefreshTokenGrantRequest) Validate ¶
func (r *RefreshTokenGrantRequest) Validate(scopes []string) error
Validate validates the RefreshTokenGrantRequest against the current scopes. If any scope(s) that is not authorized currently was requested, returns ErrInsufficientScopes.
type Request ¶
Click to show internal directories.
Click to hide internal directories.