Documentation
¶
Overview ¶
Package authenticator is responsible for handling the authentication of users with third party identity providers.
Index ¶
- Variables
- func NewAuthenticatorService(opts Options) (*service, error)
- func NewOIDCIssuer(t *testing.T, username, aud, name string) string
- type OAuthClient
- func (a *OAuthClient) CallbackHandler(r *http.Request) (*oauth2.Token, error)
- func (a *OAuthClient) CallbackPath() string
- func (a *OAuthClient) NewClient(ctx context.Context, token *oauth2.Token) (cloud.Client, error)
- func (a *OAuthClient) RequestHandler(w http.ResponseWriter, r *http.Request)
- func (a *OAuthClient) RequestPath() string
- func (a *OAuthClient) String() string
- type OAuthClientConfig
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // "openid" is a required scope for OpenID Connect flows, and profile // gives OTF access to the user's username. DefaultScopes = []string{oidc.ScopeOpenID, "profile"} ErrMissingOIDCIssuerURL = errors.New("missing oidc-issuer-url") )
View Source
var ErrOAuthCredentialsIncomplete = errors.New("must specify both client ID and client secret")
Functions ¶
func NewAuthenticatorService ¶
Types ¶
type OAuthClient ¶
type OAuthClient struct {
internal.HostnameService // for retrieving otf system hostname for use in redirects back to otf
*oauth2.Config
// contains filtered or unexported fields
}
OAuthClient performs the client role in an oauth handshake, requesting authorization from the user to access their account details on a particular cloud.
func NewOAuthClient ¶
func NewOAuthClient(cfg OAuthClientConfig) (*OAuthClient, error)
func (*OAuthClient) CallbackHandler ¶
func (*OAuthClient) CallbackPath ¶
func (a *OAuthClient) CallbackPath() string
func (*OAuthClient) NewClient ¶
NewClient constructs a cloud client configured with the given oauth token for authentication.
func (*OAuthClient) RequestHandler ¶
func (a *OAuthClient) RequestHandler(w http.ResponseWriter, r *http.Request)
RequestHandler initiates the oauth flow, redirecting user to the auth server
func (*OAuthClient) RequestPath ¶
func (a *OAuthClient) RequestPath() string
func (*OAuthClient) String ¶
func (a *OAuthClient) String() string
String provides a human-readable identifier for the oauth client, using the name of its underlying cloud provider
type OAuthClientConfig ¶
type OAuthClientConfig struct {
cloud.CloudOAuthConfig
// contains filtered or unexported fields
}
OAuthClientConfig is configuration for constructing an OAuth client
type Options ¶
type Options struct {
logr.Logger
html.Renderer
internal.HostnameService
organization.OrganizationService
auth.AuthService
tokens.TokensService
Configs []cloud.CloudOAuthConfig
OIDCConfigs []cloud.OIDCConfig
}
Click to show internal directories.
Click to hide internal directories.