Documentation ¶
Index ¶
- type Client
- func (c *Client) Exchange(ctx context.Context, code string) (*oauth.IDToken, error)
- func (c *Client) GetOAuthLoginURL() string
- func (c *Client) IDToken(tokenSource oauth2.TokenSource) (*oauth.IDToken, error)
- func (c *Client) TokenSourceFromCredentials(ctx context.Context, credentials []byte) (oauth2.TokenSource, error)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
TODO: Need a way to exchange the refresh token for another access token Client encapsulates all OAuth actions
func (*Client) GetOAuthLoginURL ¶
GetOAuthLoginURL returns the OAuth login URL
func (*Client) IDToken ¶
IDToken takes in a token source, validates it, and returns an ID token TODO: For now, we're not using the production version - we're just hitting an endpoint to validate that the token is valid. To productionize this we should be hitting the JWKS URI
func (*Client) TokenSourceFromCredentials ¶
func (c *Client) TokenSourceFromCredentials(ctx context.Context, credentials []byte) (oauth2.TokenSource, error)
TokenSourceFromCredentials takes in a credentials file and returns a token source
type Option ¶
type Option func(o *Options)
Option is functional way of setting options for the OAuthClient
func WithClient ¶
WithClient sets an HTTP client on the Option
func WithConfig ¶
WithConfig sets the OAuth configs on the Options struct
func WithLogger ¶
WithLogger sets logger on the Options struct