Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator interface {
// RequestAuth returns a http.HandlerFunc that redirects the user to the OAuth2 provider for authentication and gets the authorization code.
RequestAuth() http.HandlerFunc
// Callback returns a http.HandlerFunc that exchanges the authorization code for an access token and fetches user info from the OAuth2 provider.
Callback() http.HandlerFunc
}
Authenticator is an interface for OAuth2 authenticators.
func NewAuthentikAuthenticator ¶
func NewAuthentikAuthenticator(config *oauth2.Config, userInfoURL string, lc log.Logger) Authenticator
NewAuthentikAuthenticator creates a new Authenticator for authentik.
type AuthentikAuthenticator ¶
type AuthentikAuthenticator struct {
Config *oauth2.Config
UserInfoURL string
// contains filtered or unexported fields
}
func (*AuthentikAuthenticator) Callback ¶
func (a *AuthentikAuthenticator) Callback() http.HandlerFunc
Callback returns a http.HandlerFunc that exchanges the authorization code for an access token and fetches user info from the OAuth2 provider.
func (*AuthentikAuthenticator) RequestAuth ¶
func (a *AuthentikAuthenticator) RequestAuth() http.HandlerFunc
RequestAuth returns a http.HandlerFunc that redirects the user to the OAuth2 provider for authentication.
type AuthentikUserInfo ¶
type AuthentikUserInfo struct {
Sub string `json:"sub"`
Email string `json:"email"`
VerifiedEmail bool `json:"email_verified"`
Name string `json:"name"`
GivenName string `json:"given_name"`
PreferredUsername string `json:"preferred_username"`
Nickname string `json:"nickname"`
Groups []string `json:"groups"`
// Custom fields of a more common name for the user ID
UserID string `json:"id"`
}
func (*AuthentikUserInfo) Validate ¶
func (u *AuthentikUserInfo) Validate() error
Validate validates user info
Click to show internal directories.
Click to hide internal directories.