Versions in this module Expand all Collapse all v0 v0.19.4 May 24, 2023 Changes in this version + const ProviderHeaderKey + const UsersStoreKey + var ErrAuthSourceNotActived = errors.New("auth source is not actived") + func ClearProviders() + func GetActiveOAuth2Providers() ([]string, map[string]Provider, error) + func Init() error + func InitSigningKey() error + func IsErrOpenIDConnectInitialize(err error) bool + func RegisterGothProvider(provider GothProvider) + func RegisterProviderWithGothic(providerName string, source *Source) error + func RemoveProviderFromGothic(providerName string) + func ResetOAuth2() error + type Attribute struct + Available bool + Required bool + Value string + type BaseProvider struct + func (b *BaseProvider) CustomURLSettings() *CustomURLSettings + func (b *BaseProvider) DisplayName() string + func (b *BaseProvider) Image() string + func (b *BaseProvider) Name() string + type CustomProvider struct + func NewCustomProvider(name, displayName string, customURLSetting *CustomURLSettings, ...) *CustomProvider + func (c *CustomProvider) CreateGothProvider(providerName, callbackURL string, source *Source) (goth.Provider, error) + func (c *CustomProvider) CustomURLSettings() *CustomURLSettings + type CustomProviderNewFn func(clientID, secret, callbackURL string, custom *CustomURLMapping, ...) (goth.Provider, error) + type CustomURLMapping struct + AuthURL string + EmailURL string + ProfileURL string + Tenant string + TokenURL string + type CustomURLSettings struct + AuthURL Attribute + EmailURL Attribute + ProfileURL Attribute + Tenant Attribute + TokenURL Attribute + func (c *CustomURLSettings) OverrideWith(override *CustomURLMapping) *CustomURLMapping + func (c *CustomURLSettings) Required() bool + type ErrInvalidAlgorithmType struct + Algorithm string + func (err ErrInvalidAlgorithmType) Error() string + type ErrOpenIDConnectInitialize struct + Cause error + OpenIDConnectAutoDiscoveryURL string + ProviderName string + func (err ErrOpenIDConnectInitialize) Error() string + func (err ErrOpenIDConnectInitialize) Unwrap() error + type GothProvider interface + type GothProviderCreator interface + CreateGothProvider func(providerName, callbackURL string, source *Source) (goth.Provider, error) + type ImagedProvider struct + func NewImagedProvider(image string, provider GothProvider) *ImagedProvider + func (i *ImagedProvider) Image() string + type JWTSigningKey interface + IsSymmetric func() bool + PreProcessToken func(*jwt.Token) + SignKey func() interface{} + SigningMethod func() jwt.SigningMethod + ToJWK func() (map[string]string, error) + VerifyKey func() interface{} + var DefaultSigningKey JWTSigningKey + func CreateJWTSigningKey(algorithm string, key interface{}) (JWTSigningKey, error) + type OIDCToken struct + Email string + EmailVerified bool + Groups []string + Locale string + Name string + Nonce string + Picture string + PreferredUsername string + Profile string + UpdatedAt timeutil.TimeStamp + Website string + func (token *OIDCToken) SignToken(signingKey JWTSigningKey) (string, error) + type OpenIDProvider struct + func (o *OpenIDProvider) CreateGothProvider(providerName, callbackURL string, source *Source) (goth.Provider, error) + func (o *OpenIDProvider) CustomURLSettings() *CustomURLSettings + func (o *OpenIDProvider) DisplayName() string + func (o *OpenIDProvider) Image() string + func (o *OpenIDProvider) Name() string + type Provider interface + CustomURLSettings func() *CustomURLSettings + DisplayName func() string + Image func() string + Name func() string + func GetOAuth2Providers() []Provider + type SessionsStore struct + func (st *SessionsStore) Get(r *http.Request, name string) (*sessions.Session, error) + func (st *SessionsStore) New(r *http.Request, name string) (*sessions.Session, error) + func (st *SessionsStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error + type SimpleProvider struct + func NewSimpleProvider(name, displayName string, scopes []string, newFn SimpleProviderNewFn) *SimpleProvider + func (c *SimpleProvider) CreateGothProvider(providerName, callbackURL string, source *Source) (goth.Provider, error) + type SimpleProviderNewFn func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider + type Source struct + AdminGroup string + ClientID string + ClientSecret string + CustomURLMapping *CustomURLMapping + GroupClaimName string + GroupTeamMap string + GroupTeamMapRemoval bool + IconURL string + OpenIDConnectAutoDiscoveryURL string + Provider string + RequiredClaimName string + RequiredClaimValue string + RestrictedGroup string + Scopes []string + SkipLocalTwoFA bool + func (source *Source) Authenticate(user *user_model.User, login, password string) (*user_model.User, error) + func (source *Source) Callback(request *http.Request, response http.ResponseWriter) (goth.User, error) + func (source *Source) Callout(request *http.Request, response http.ResponseWriter) error + func (source *Source) DisplayName() string + func (source *Source) FromDB(bs []byte) error + func (source *Source) Name() string + func (source *Source) RegisterSource() error + func (source *Source) SetAuthSource(authSource *auth.Source) + func (source *Source) ToDB() ([]byte, error) + func (source *Source) UnregisterSource() error + type Token struct + Counter int64 + GrantID int64 + Type TokenType + func ParseToken(jwtToken string, signingKey JWTSigningKey) (*Token, error) + func (token *Token) SignToken(signingKey JWTSigningKey) (string, error) + type TokenType int + const TypeAccessToken + const TypeRefreshToken