oidc

package
v0.0.0-...-b4bec84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OIDCProvider

type OIDCProvider struct {
	// Defines how Clients dynamically discover information about OpenID Providers
	// See also, https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig
	Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"`

	// ClientID is the application's ID.
	ClientID string `json:"client_id" yaml:"clientID"` // nolint

	// ClientSecret is the application's secret.
	ClientSecret string `json:"-" yaml:"clientSecret"`

	// Endpoint contains the resource server's token endpoint URLs.
	// These are constants specific to each server and are often available via site-specific packages,
	// such as google.Endpoint or github.Endpoint.
	Endpoint endpoint `json:"endpoint" yaml:"endpoint"`

	// RedirectURL is the URL to redirect users going through
	// the OAuth flow, after the resource owner's URLs.
	RedirectURL string `json:"redirect_url" yaml:"redirectURL"` // nolint

	// Scope specifies optional requested permissions.
	Scopes []string `json:"scopes" yaml:"scopes"`

	// GetUserInfo uses the userinfo endpoint to get additional claims for the token.
	// This is especially useful where upstreams return "thin" id tokens
	// See also, https://openid.net/specs/openid-connect-core-1_0.html#UserInfo
	GetUserInfo bool `json:"get_user_info" yaml:"getUserInfo"`

	// Used to turn off TLS certificate checks.
	InsecureSkipVerify bool `json:"insecure_skip_verify" yaml:"insecureSkipVerify"`

	// Configurable key which contains the email claims.
	EmailKey string `json:"email_key" yaml:"emailKey"`

	// Configurable key which contains the preferred username claims.
	PreferredUsernameKey string `json:"preferred_username_key" yaml:"preferredUsernameKey"`

	Provider     *oidc.Provider        `json:"-" yaml:"-"`
	OAuth2Config *oauth2.Config        `json:"-" yaml:"-"`
	Verifier     *oidc.IDTokenVerifier `json:"-" yaml:"-"`
}

func (*OIDCProvider) AuthCodeURL

func (o *OIDCProvider) AuthCodeURL(state, nonce string) string

func (*OIDCProvider) Authenticate

func (o *OIDCProvider) Authenticate(username string, password string) (idprovider.Identity, error)

nolint

func (*OIDCProvider) AuthenticateCode

func (o *OIDCProvider) AuthenticateCode(code string) (idprovider.Identity, error)

nolint

func (*OIDCProvider) Type

func (o *OIDCProvider) Type() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL