Documentation ¶
Index ¶
- Constants
- func BearerHeaderDecoder(codecs ...securecookie.Codec) *bearerDecoder
- func ContextWithToken(parent context.Context, t *Token) context.Context
- func CreateAuth(secret string) (string, string, error)
- func OpenBrowserCMD(url string) *exec.Cmd
- func VerifyAuth(secret, nonce, authMessage string) (bool, error)
- func Workflow(callbackURI string, configProvider ConfigProvider, ...) (mux.MiddlewareFunc, error)
- type AuthenticationRequiredFunc
- type AuthorizeParams
- type AuthorizedHandleFunc
- type Client
- type CodeChallenge
- type CodeChallengeResult
- type Config
- type ConfigProvider
- type GetAccessTokenParams
- type Provider
- type RedirectURIHandler
- type Token
Constants ¶
View Source
const ( ParamClientID = "client_id" // ParamNonce = "nonce" // ParamClientAuthMessage = "auth_message" ParamResponseType = "response_type" ParamState = "state" ParamScope = "scope" ParamRedirectURI = "redirect_uri" ParamCode = "code" ParamProvider = "provider" ParamAlg = "algorithm" ParamError = "error" ParamErrorDescription = "error_description" // ParamErrorUri = "error_uri" ParamGrantType = "grant_type" ParamToken = "token" ResponseTypeCode = "code" ErrorInvalidRequest = "invalid_request" // ErrorUnauthorizedClient = "unauthorized_client" ErrorAccessDenied = "access_denied" ErrorUnsupportedResponseType = "unsupported_response_type" // ErrorInvalidScope = "invalid_scope" ErrorServerError = "server_error" GrantTypeAuthorizationCode = "authorization_code" KeyAccessToken = "access_token" KeyTokenType = "token_type" KeyExpiresIn = "expires_in" KeyIdToken = "id_token" // KeyRefreshToken = "refresh_token" KeyScope = "scope" )
Variables ¶
This section is empty.
Functions ¶
func BearerHeaderDecoder ¶
func BearerHeaderDecoder(codecs ...securecookie.Codec) *bearerDecoder
func OpenBrowserCMD ¶
func VerifyAuth ¶
func Workflow ¶
func Workflow(callbackURI string, configProvider ConfigProvider, authRequiredFunc AuthenticationRequiredFunc, handlerFunc AuthorizedHandleFunc) (mux.MiddlewareFunc, error)
Types ¶
type AuthorizeParams ¶
type AuthorizeParams struct { ClientID string ResponseType string State string Scope string RedirectURI string Missing []string }
Params
func (*AuthorizeParams) Has ¶
func (p *AuthorizeParams) Has(param string) bool
func (*AuthorizeParams) ToMap ¶
func (p *AuthorizeParams) ToMap() map[string]string
type AuthorizedHandleFunc ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client
func (*Client) GetURLAuthorizationURL ¶
type CodeChallenge ¶
CodeChallenge
func CreateCodeChallenge ¶
func CreateCodeChallenge(secret string) (*CodeChallenge, string, error)
func (*CodeChallenge) ProcessChallenge ¶
func (c *CodeChallenge) ProcessChallenge(secret string) ([]byte, error)
type CodeChallengeResult ¶
CodeChallengeResult
type Config ¶
type Config struct { ClientID string `json:"client_id"` Secret string `json:"secret"` Scope string `json:"scope"` State string `json:"state"` CallbackURL string `json:"callback_url"` AuthorizationEndpoint string `json:"authorize_endpoint"` TokenEndpoint string `json:"token_endpoint"` AuthorityCertFilename string `json:"authority_certificate"` }
type ConfigProvider ¶
type GetAccessTokenParams ¶
type RedirectURIHandler ¶
type RedirectURIHandler struct {
// contains filtered or unexported fields
}
RedirectURIHandler
func NewRedirectURIHandler ¶
func NewRedirectURIHandler(redirectURI string, tc *tls.Config) *RedirectURIHandler
func (*RedirectURIHandler) GetCode ¶
func (h *RedirectURIHandler) GetCode() (string, error)
Click to show internal directories.
Click to hide internal directories.