Documentation ¶
Index ¶
- Constants
- func GetEnv(key, fallback string) string
- func GetEnvBool(key string, defaultValue bool) bool
- type Authenticator
- func (auth *Authenticator) GetProvider() *oidc.Provider
- func (auth *Authenticator) GetTokenVerifier() *oidc.IDTokenVerifier
- func (auth *Authenticator) LoadAuthContext() gin.HandlerFunc
- func (auth *Authenticator) Logout(gc *gin.Context, redirectPath string)
- func (auth *Authenticator) Middleware(requiredGroups []string) gin.HandlerFunc
- func (auth *Authenticator) OIDCCallBack(gc *gin.Context, redirectPath string)
- func (auth *Authenticator) OIDCRedirectToLogin(gc *gin.Context)
- func (auth *Authenticator) VerifyClaims(gc *gin.Context, token string) (*models.User, error)
- type Config
- type ConfigMode
- type IAuth
- type Provider
- type UserClaimsConfig
Constants ¶
View Source
const ( DEFAULT_OIDC_CALLBACK_PATH = "/oidc-callback" COOKIE_ENCRYPTION_KEY_LENGTH = 32 COOKIE_SECRET_KEY_LENGTH = 32 )
Variables ¶
This section is empty.
Functions ¶
func GetEnvBool ¶
Types ¶
type Authenticator ¶
type Authenticator struct { Cookiejar cookies.ICookieJar OIDCconfig *oidc.Config OauthConfig *oauth2.Config // contains filtered or unexported fields }
func New ¶
func New(config *Config) (*Authenticator, error)
func (*Authenticator) GetProvider ¶
func (auth *Authenticator) GetProvider() *oidc.Provider
func (*Authenticator) GetTokenVerifier ¶
func (auth *Authenticator) GetTokenVerifier() *oidc.IDTokenVerifier
func (*Authenticator) LoadAuthContext ¶
func (auth *Authenticator) LoadAuthContext() gin.HandlerFunc
func (*Authenticator) Logout ¶
func (auth *Authenticator) Logout(gc *gin.Context, redirectPath string)
func (*Authenticator) Middleware ¶
func (auth *Authenticator) Middleware(requiredGroups []string) gin.HandlerFunc
func (*Authenticator) OIDCCallBack ¶
func (auth *Authenticator) OIDCCallBack(gc *gin.Context, redirectPath string)
func (*Authenticator) OIDCRedirectToLogin ¶
func (auth *Authenticator) OIDCRedirectToLogin(gc *gin.Context)
func (*Authenticator) VerifyClaims ¶
type Config ¶
type Config struct { Mode ConfigMode ProviderLink string ClientID string ClientSecret string SkipTLSValidation bool OidcCallbackPath string CookieJarSecret string CookieEncryptionKey string RedirectURL string Provider Provider }
func DefaultConfig ¶
func DefaultConfig() *Config
func OIDCRedirectConfig ¶
func OIDCRedirectConfig() *Config
type UserClaimsConfig ¶
type UserClaimsConfig struct { OIDCClaimUsernameField string OIDCClaimEmailField string OIDCClaimNameField string OIDCClaimGroupsField string }
func GetUserClaims ¶
func GetUserClaims(provider Provider) *UserClaimsConfig
Click to show internal directories.
Click to hide internal directories.