Documentation
¶
Index ¶
- Constants
- func HandleAuthorizationServerMetadata(w http.ResponseWriter, r *http.Request)
- func HandleAuthorize(w http.ResponseWriter, r *http.Request)
- func HandleGrant(w http.ResponseWriter, r *http.Request)
- func HandleToken(w http.ResponseWriter, r *http.Request)
- type AuthCode
- type AuthCodeStore
- type AuthorizationServerMetadata
- type ErrorResponse
- type OpenIDConfiguration
- type TokenResponse
Constants ¶
View Source
const (
AuthCodeExpiry = 10 * time.Minute // OAuth2 spec recommends max 10 minutes
)
Variables ¶
This section is empty.
Functions ¶
func HandleAuthorizationServerMetadata ¶
func HandleAuthorizationServerMetadata(w http.ResponseWriter, r *http.Request)
func HandleAuthorize ¶
func HandleAuthorize(w http.ResponseWriter, r *http.Request)
HandleAuthorize handles the OAuth2 authorization endpoint
func HandleGrant ¶
func HandleGrant(w http.ResponseWriter, r *http.Request)
HandleGrant handles the OAuth2 grant approval
func HandleToken ¶
func HandleToken(w http.ResponseWriter, r *http.Request)
HandleToken handles the OAuth2 token endpoint
Types ¶
type AuthCodeStore ¶
type AuthCodeStore struct {
// contains filtered or unexported fields
}
func GetAuthCodeStore ¶
func GetAuthCodeStore() *AuthCodeStore
func (*AuthCodeStore) ConsumeAuthCode ¶
func (s *AuthCodeStore) ConsumeAuthCode(code string) (*AuthCode, bool)
func (*AuthCodeStore) CreateAuthCode ¶
func (s *AuthCodeStore) CreateAuthCode(userId, clientId, redirectURI, scope string) (*AuthCode, error)
type AuthorizationServerMetadata ¶
type AuthorizationServerMetadata struct {
Issuer string `json:"issuer"`
AuthorizationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
ResponseTypesSupported []string `json:"response_types_supported"`
GrantTypesSupported []string `json:"grant_types_supported"`
TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
ScopesSupported []string `json:"scopes_supported,omitempty"`
CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported,omitempty"`
}
type ErrorResponse ¶
type OpenIDConfiguration ¶
type OpenIDConfiguration struct {
Issuer string `json:"issuer"`
AuthorizationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
UserinfoEndpoint string `json:"userinfo_endpoint"`
JwksURI string `json:"jwks_uri"`
ResponseTypesSupported []string `json:"response_types_supported"`
SubjectTypesSupported []string `json:"subject_types_supported"`
IDTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"`
ScopesSupported []string `json:"scopes_supported"`
TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
ClaimsSupported []string `json:"claims_supported"`
}
Click to show internal directories.
Click to hide internal directories.