Documentation
¶
Index ¶
- Constants
- type AuthStyle
- type Config
- func (c Config) AuthCodeURL(csrfToken string) string
- func (c Config) ToClientCredentials(tokenURL, clientSecret string) clientcredentials.Config
- func (c Config) ToDefaultClientCredentials() clientcredentials.Config
- func (c Config) ToDefaultOAuth2() oauth2.Config
- func (c Config) ToOAuth2(authURL, tokenURL, clientSecret string) oauth2.Config
- func (c *Config) Validate() error
- type GrantType
Constants ¶
View Source
const ( // AuthStyleAutoDetect means to auto-detect which authentication // style the provider wants by trying both ways and caching // the successful way for the future. AuthStyleAutoDetect AuthStyle = "autoDetect" // AuthStyleInParams sends the "client_id" and "client_secret" // in the POST body as application/x-www-form-urlencoded parameters. AuthStyleInParams AuthStyle = "inParams" // AuthStyleInHeader sends the client_id and client_password // using HTTP Basic Authorization. This is an optional style // described in the OAuth2 RFC 6749 section 2.3.1. AuthStyleInHeader AuthStyle = "inHeader" ClientCredentials GrantType = "clientCredentials" AuthorizationCode GrantType = "authorizationCode" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ClientID string `yaml:"clientID" json:"clientId"`
ClientSecretFile string `yaml:"clientSecretFile" json:"clientSecretFile"`
Scopes []string `yaml:"scopes" json:"scopes"`
AuthURL string `yaml:"-" json:"authUrl"`
TokenURL string `yaml:"-" json:"tokenUrl"`
AuthStyle AuthStyle `yaml:"authStyle" json:"authStyle"`
Audience string `yaml:"audience" json:"audience"`
RedirectURL string `yaml:"redirectURL" json:"redirectUrl"`
AccessType string `yaml:"accessType" json:"accessType"`
ResponseType string `yaml:"responseType" json:"responseType"`
ResponseMode string `yaml:"responseMode" json:"responseMode"`
ClientSecret string `yaml:"-" json:"clientSecret"`
GrantType GrantType `yaml:"grantType" json:"grantType"`
}
TODO cleanup settings AccessType, ResponseType, ResponseMode, AuthStyle - be careful it is used by c2c.
func (Config) AuthCodeURL ¶
func (Config) ToClientCredentials ¶ added in v2.2.4
func (c Config) ToClientCredentials(tokenURL, clientSecret string) clientcredentials.Config
func (Config) ToDefaultClientCredentials ¶ added in v2.2.4
func (c Config) ToDefaultClientCredentials() clientcredentials.Config
func (Config) ToDefaultOAuth2 ¶
Click to show internal directories.
Click to hide internal directories.