Documentation
¶
Index ¶
- type Client
- type ClientConfig
- type Config
- type IDPParam
- type Provider
- func (p *Provider) Client(provider string) *Client
- func (p *Provider) ClientForDomain(domain string) *Client
- func (p *Provider) ClientForEmail(email string) *Client
- func (p *Provider) ClientForProvider(provider string) *Client
- func (p *Provider) ClientNames() []string
- func (p *Provider) Domains() []string
- func (p *Provider) Emails() []string
- func (p *Provider) RegisterClient(c *ClientConfig, override bool) error
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"`
// JwksURL specifies JWKS URL
JwksURL string `json:"jwks_url" yaml:"jwks_url"`
// 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"`
// Prompt parameter, such as `consent`
Prompt string `json:"prompt" yaml:"prompt"`
// Audience of JWT token
Audience string `json:"audience" yaml:"audience"`
// Issuer of JWT token
Issuer string `json:"issuer" yaml:"issuer"`
// IDPParam specifies the IDP parameters
IDPParam *IDPParam `json:"idp_param" yaml:"idp_param"`
// Domains specifies the list of domains to filter by
Domains []string `json:"domains" yaml:"domains"`
// Emails specifies the list of emails to filter by
Emails []string `json:"emails" yaml:"emails"`
}
ClientConfig provides OAuth2 configuration
type Config ¶
type Config struct {
// Clients provides a list of supported clients
Clients []*ClientConfig `json:"clients" yaml:"clients"`
}
Config provides OAuth2 configuration for supported clients
func LoadConfig ¶
LoadConfig returns configuration loaded from a file
type IDPParam ¶ added in v0.9.0
type IDPParam struct {
// Name specifies the name of the IDP parameter: idpuser.email|identity_provider
Name string `json:"name" yaml:"name"`
// Value specifies the value the IDP parameter: email|domain|{value}
Value string `json:"value" yaml:"value"`
}
IDPParam is a struct for IDP parameter
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider of OAuth2 clients
func LoadProvider ¶
LoadProvider returns Provider
func NewProvider ¶ added in v0.9.0
NewProvider returns Provider
func (*Provider) ClientForDomain ¶ added in v0.9.0
ClientForDomain returns Client by domain
func (*Provider) ClientForEmail ¶ added in v0.10.0
ClientForEmail returns Client by email
func (*Provider) ClientForProvider ¶ added in v0.9.0
ClientForDomain returns Client by domain
func (*Provider) ClientNames ¶ added in v0.5.0
ClientNames returns list of supported clients
func (*Provider) RegisterClient ¶ added in v0.9.0
func (p *Provider) RegisterClient(c *ClientConfig, override bool) error
RegisterClient registers new client