Documentation
¶
Index ¶
- type AuthorizationCodeFlow
- type Client
- func (c Client) EndSession(ctx context.Context, refreshToken string) error
- func (c Client) ExchangeAuthCode(ctx context.Context, code string, redirectUri xurl.URL, verifier string) (resp Token, err error)
- func (c Client) NewAuthorizationCode(redirectURI xurl.URL) AuthorizationCodeFlow
- func (c Client) Refresh(ctx context.Context, refreshToken string, scopes scope.Scopes) (resp Token, err error)
- type ClientConfig
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationCodeFlow ¶
type AuthorizationCodeFlow struct {
Client
RedirectURI xurl.URL
// contains filtered or unexported fields
}
AuthorizationCodeFlow is one run of the authorization code flow with PKCE.
func (AuthorizationCodeFlow) BrowserUrl ¶
func (a AuthorizationCodeFlow) BrowserUrl() xurl.URL
func (AuthorizationCodeFlow) CheckState ¶
func (a AuthorizationCodeFlow) CheckState(state string) error
type Client ¶
type Client struct {
http.Client
ClientConfig
Id string
}
func (Client) EndSession ¶
func (Client) ExchangeAuthCode ¶
func (c Client) ExchangeAuthCode(ctx context.Context, code string, redirectUri xurl.URL, verifier string) (resp Token, err error)
ExchangeAuthCode ends the authorization code flow, see AuthorizationCodeFlow.Exchange.
func (Client) NewAuthorizationCode ¶
func (c Client) NewAuthorizationCode(redirectURI xurl.URL) AuthorizationCodeFlow
type ClientConfig ¶
type ClientConfig struct {
Issuer xurl.URL `json:"issuer"`
AuthorizationEndpoint xurl.URL `json:"authorization_endpoint"`
TokenEndpoint xurl.URL `json:"token_endpoint"`
// Both are optional in the discovery document, and either one ends a session.
EndSessionEndpoint *xurl.URL `json:"end_session_endpoint"`
RevocationEndpoint *xurl.URL `json:"revocation_endpoint"`
}
Click to show internal directories.
Click to hide internal directories.