Documentation
¶
Index ¶
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
}
Client of OAuth2
func LoadClient ¶
LoadClient returns a single `Client` loaded from config
func (*Client) CreateTokenRequest ¶
func (p *Client) CreateTokenRequest(v url.Values, authStyle oauth2.AuthStyle) (*http.Request, error)
CreateTokenRequest returns a new *http.Request to retrieve a new token from tokenURL using the provided clientID, clientSecret, and POST body parameters.
func (*Client) SetClientSecret ¶
SetClientSecret sets Client Secret
type ClientConfig ¶
type ClientConfig struct {
// ProviderID specifies Auth.Provider ID
ProviderID string `json:"provider_id" yaml:"provider_id"`
// ClientID specifies client ID
ClientID string `json:"client_id" yaml:"client_id"`
// ClientSecret specifies client secret
ClientSecret string `json:"client_secret" yaml:"client_secret"`
// Scopes specifies the list of scopes
Scopes []string `json:"scopes" yaml:"scopes"`
// ResponseType specifies the response type, default is "code"
ResponseType string `json:"response_type" yaml:"response_type"`
// AuthURL specifies auth URL
AuthURL string `json:"auth_url" yaml:"auth_url"`
// TokenURL specifies token URL
TokenURL string `json:"token_url" yaml:"token_url"`
// UserinfoURL specifies userinfo URL
UserinfoURL string `json:"userinfo_url" yaml:"userinfo_url"`
// WellknownURL specifies URL for wellknown info
WellknownURL string `json:"wellknown" yaml:"wellknown"`
// RedirectURL specifies redirect URL
RedirectURL string `json:"redirect_url" yaml:"redirect_url"`
// PubKey specifies PEM encoded Public Key of the JWT issuer
PubKey string `json:"pubkey" yaml:"pubkey"`
// Audience of JWT token
Audience string `json:"audience" yaml:"audience"`
// Issuer of JWT token
Issuer string `json:"issuer" yaml:"issuer"`
}
ClientConfig provides OAuth2 configuration
type Config ¶
type Config struct {
// Clients provides a list of supported clients
Clients []*ClientConfig
}
Config provides OAuth2 configuration for supported clients
func LoadConfig ¶
LoadConfig returns configuration loaded from a file
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider of OAuth2 clients
func LoadProvider ¶
LoadProvider returns Provider
Click to show internal directories.
Click to hide internal directories.