Documentation
¶
Index ¶
- Constants
- func AuthorizationErrorResponseHandler(w http.ResponseWriter, redirectURL *url.URL, state string, ...)
- func TokenErrorResponseHandler(w http.ResponseWriter, r *http.Request, ...)
- func TokenErrorStatusResponseHandler(w http.ResponseWriter, r *http.Request, statusCode int, ...)
- type AccessToken
- type AccessTokenResponse
- type AuthorizationErrorResponseParameter
- type AuthorizationErrorType
- type ClientType
- type GrantType
- type IntrospectTokenType
- type RefreshToken
- type ResponseType
- type TokenErrorResponseParameter
- type TokenErrorType
- type TokenType
Constants ¶
const ( ParameterResponseType string = "response_type" ParameterRedirectUri string = "redirect_uri" ParameterState string = "state" ParameterScope string = "scope" ParameterClientId string = "client_id" ParameterClientSecret string = "client_secret" ParameterGrantType string = "grant_type" ParameterTokenType string = "token_type" ParameterAccessToken string = "access_token" ParameterRefreshToken string = "refresh_token" ParameterExpiresIn string = "expires_in" ParameterCode string = "code" ParameterUsername string = "username" ParameterPassword string = "password" ParameterToken string = "token" ParameterTokenTypeHint string = "token_type_hint" ParameterError string = "error" ParameterErrorDescription string = "error_description" ParameterErrorUri string = "error_uri" )
Variables ¶
This section is empty.
Functions ¶
func AuthorizationErrorResponseHandler ¶
func AuthorizationErrorResponseHandler(w http.ResponseWriter, redirectURL *url.URL, state string, errorResponseParameter *AuthorizationErrorResponseParameter)
func TokenErrorResponseHandler ¶
func TokenErrorResponseHandler(w http.ResponseWriter, r *http.Request, errorResponseParameter *TokenErrorResponseParameter)
func TokenErrorStatusResponseHandler ¶
func TokenErrorStatusResponseHandler(w http.ResponseWriter, r *http.Request, statusCode int, errorResponseParameter *TokenErrorResponseParameter)
Types ¶
type AccessToken ¶
type AccessTokenResponse ¶
type AccessTokenResponse struct { AccessTokenValue string `json:"access_token,omitempty"` TokenType TokenType `json:"token_type,omitempty"` ExpiresIn int `json:"expires_in,omitempty"` // seconds RefreshTokenValue string `json:"refresh_token,omitempty"` IdTokenValue string `json:"id_token,omitempty"` // https://openid.net/specs/openid-connect-core-1_0.html#IDToken }
AccessTokenResponse as described in https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4
type AuthorizationErrorResponseParameter ¶
type AuthorizationErrorResponseParameter struct { Error AuthorizationErrorType Description string Uri string }
AuthorizationErrorResponseParameter related to https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1
type AuthorizationErrorType ¶
type AuthorizationErrorType string
AuthorizationErrorType as described in multiple places e.g. https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1
const ( AuthorizationEtInvalidRequest AuthorizationErrorType = "invalid_request" AuthorizationEtAccessDenied AuthorizationErrorType = "access_denied" AuthorizationEtUnsupportedResponseType AuthorizationErrorType = "unsupported_response_type" AuthorizationEtInvalidScope AuthorizationErrorType = "invalid_scope" AuthorizationEtServerError AuthorizationErrorType = "server_error" // AuthorizationEtInteractionRequired and following extended by https://openid.net/specs/openid-connect-core-1_0.html#AuthError AuthorizationEtInteractionRequired AuthorizationErrorType = "interaction_required" AuthorizationEtLoginRequired AuthorizationErrorType = "login_required" AuthorizationEtAccountSelectionRequired AuthorizationErrorType = "account_selection_required" AuthorizationEtConsentRequired AuthorizationErrorType = "consent_required" AuthorizationEtInvalidRequestUri AuthorizationErrorType = "invalid_request_uri" AuthorizationEtInvalidRequestObject AuthorizationErrorType = "invalid_request_object" AuthorizationEtRequestNotSupported AuthorizationErrorType = "request_not_supported" AuthorizationEtRequestUriNotSupported AuthorizationErrorType = "request_uri_not_supported" AuthorizationEtRegistrationNotSupported AuthorizationErrorType = "registration_not_supported" )
func AuthorizationErrorTypeFromString ¶
func AuthorizationErrorTypeFromString(value string) (AuthorizationErrorType, bool)
type ClientType ¶
type ClientType string
ClientType as described in https://datatracker.ietf.org/doc/html/rfc6749#section-2.1
const ( CtConfidential ClientType = "confidential" CtPublic ClientType = "public" )
func ClientTypeFromString ¶
func ClientTypeFromString(value string) (ClientType, bool)
type GrantType ¶
type GrantType string
GrantType as described in - https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.10 - https://datatracker.ietf.org/doc/html/rfc7591#section-2
func GrantTypeFromString ¶
type IntrospectTokenType ¶
type IntrospectTokenType string
IntrospectTokenType as described in https://datatracker.ietf.org/doc/html/rfc7662#section-2.1
const ( ItAccessToken IntrospectTokenType = "access_token" ItRefreshToken IntrospectTokenType = "refresh_token" )
func IntrospectTokenTypeFromString ¶
func IntrospectTokenTypeFromString(value string) (IntrospectTokenType, bool)
type RefreshToken ¶
type ResponseType ¶
type ResponseType string
ResponseType as described in https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.3
const ( RtCode ResponseType = "code" RtToken ResponseType = "token" RtPassword ResponseType = "password" // aka "implicit" grant RtClientCredentials ResponseType = "client_credentials" RtIdToken ResponseType = "id_token" )
func ResponseTypeFromString ¶
func ResponseTypeFromString(value string) (ResponseType, bool)
type TokenErrorResponseParameter ¶
type TokenErrorResponseParameter struct { Error TokenErrorType `json:"error"` Description string `json:"error_description,omitempty"` Uri string `json:"error_uri,omitempty"` }
TokenErrorResponseParameter related to https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
type TokenErrorType ¶
type TokenErrorType string
TokenErrorType as described in multiple places e.g. https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
const ( TokenEtInvalidRequest TokenErrorType = "invalid_request" TokenEtInvalidClient TokenErrorType = "invalid_client" TokenEtInvalidGrant TokenErrorType = "invalid_grant" TokenEtUnsupportedGrandType TokenErrorType = "unsupported_grant_type" TokenEtInvalidScope TokenErrorType = "invalid_scope" // TokenEtUnsupportedTokenType https://datatracker.ietf.org/doc/html/rfc7009#section-2.2.1 TokenEtUnsupportedTokenType TokenErrorType = "unsupported_token_type" )
func TokenErrorTypeFromString ¶
func TokenErrorTypeFromString(value string) (TokenErrorType, bool)
type TokenType ¶
type TokenType string
TokenType as described in https://datatracker.ietf.org/doc/html/rfc6749#section-7.1
const ( TtBearer TokenType = "Bearer" // https://www.rfc-editor.org/rfc/rfc6750#section-6.1.1 TtMAC TokenType = "mac" // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-http-mac-05#section-9.3.1 )