Documentation ¶
Index ¶
- type AuthToken
- func (a AuthToken) AuthenticatorID() string
- func (a *AuthToken) Configure(yamlSource []byte) error
- func (a AuthToken) DetectUser(res http.ResponseWriter, r *http.Request) (string, []string, error)
- func (a AuthToken) Login(res http.ResponseWriter, r *http.Request) (string, []plugins.MFAConfig, error)
- func (a AuthToken) LoginFields() []plugins.LoginField
- func (a AuthToken) Logout(res http.ResponseWriter, r *http.Request) error
- func (a AuthToken) SupportsMFA() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶
type AuthToken struct { Tokens map[string]string `yaml:"tokens"` Groups map[string][]string `yaml:"groups"` }
func (AuthToken) AuthenticatorID ¶
AuthenticatorID needs to return an unique string to identify this special authenticator
func (*AuthToken) Configure ¶
Configure loads the configuration for the Authenticator from the global config.yaml file which is passed as a byte-slice. If no configuration for the Authenticator is supplied the function needs to return the plugins.ErrProviderUnconfigured
func (AuthToken) DetectUser ¶
DetectUser is used to detect a user without a login form from a cookie, header or other methods If no user was detected the plugins.ErrNoValidUserFound needs to be returned
func (AuthToken) Login ¶
func (a AuthToken) Login(res http.ResponseWriter, r *http.Request) (string, []plugins.MFAConfig, error)
Login is called when the user submits the login form and needs to authenticate the user or throw an error. If the user has successfully logged in the persistent cookie should be written in order to use DetectUser for the next login. If the user did not login correctly the plugins.ErrNoValidUserFound needs to be returned
func (AuthToken) LoginFields ¶
func (a AuthToken) LoginFields() []plugins.LoginField
LoginFields needs to return the fields required for this login method. If no login using this method is possible the function needs to return nil.
func (AuthToken) Logout ¶
Logout is called when the user visits the logout endpoint and needs to destroy any persistent stored cookies
func (AuthToken) SupportsMFA ¶
SupportsMFA returns the MFA detection capabilities of the login provider. If the provider can provide mfaConfig objects from its configuration return true. If this is true the login interface will display an additional field for this provider for the user to fill in their MFA token.