Documentation
¶
Overview ¶
Package authn is used to identify requesters
Index ¶
- type Client
- func (c *Client) Authenticate(tokens *Tokens, now time.Time) (bool, error)
- func (c *Client) AuthorizeURL(state string) string
- func (c *Client) ExchangeCode(code string) (*Tokens, error)
- func (c *Client) Refresh(tokens *Tokens) error
- func (c *Client) SyncPublicKeys(now time.Time)
- func (c *Client) ValidateToken(token string, now time.Time) error
- type Tokens
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
AuthURL string
TokenURL string
JWKSURL string
ID string
Secret string
CallbackURL string
// Set to true if you store the tokens in your database for connections to OTHER services.
// This will skip fetching the public keys from the JWKSURL, speeding up the authentication process.
// Do NOT set to true if the tokens are provided by the client in order to access YOUR service.
SkipSignatureValidation bool
// contains filtered or unexported fields
}
func (*Client) Authenticate ¶
Authenticate refreshes the user's access token if its invalid/expired and returns true if it was refreshed.
func (*Client) AuthorizeURL ¶
func (*Client) ExchangeCode ¶
ExchangeCode exchanges an authorization code for access and refresh tokens
func (*Client) SyncPublicKeys ¶
SyncPublicKeys syncs the keys if one/more is missing.
Click to show internal directories.
Click to hide internal directories.