Documentation
¶
Index ¶
- Constants
- Variables
- func ClearProviders()
- func Init(ctx context.Context) error
- func IsErrOpenIDConnectInitialize(err error) bool
- func RegisterGothProvider(provider GothProvider)
- func RegisterProviderWithGothic(providerName string, source *Source) error
- func RemoveProviderFromGothic(providerName string)
- func ResetOAuth2(ctx context.Context) error
- type Attribute
- type AuthSourceProvider
- type BaseProvider
- type CustomProvider
- type CustomProviderNewFn
- type CustomURLMapping
- type CustomURLSettings
- type ErrOpenIDConnectInitialize
- type GothProvider
- type GothProviderCreator
- type OpenIDProvider
- 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) IconHTML(size int) template.HTML
- func (o *OpenIDProvider) Name() string
- func (o *OpenIDProvider) SupportSSHPublicKey() bool
- type Provider
- type SessionsStore
- type SimpleProvider
- type SimpleProviderNewFn
- type Source
- func (source *Source) Authenticate(ctx context.Context, 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) Sync(ctx context.Context, updateExisting bool) error
- func (source *Source) ToDB() ([]byte, error)
- func (source *Source) UnregisterSource() error
Constants ¶
const ProviderHeaderKey = "gitea-oauth2-provider"
ProviderHeaderKey is the HTTP header key
Variables ¶
Functions ¶
func ClearProviders ¶
func ClearProviders()
ClearProviders clears all OAuth2 providers from the goth lib
func IsErrOpenIDConnectInitialize ¶
IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist.
func RegisterGothProvider ¶
func RegisterGothProvider(provider GothProvider)
RegisterGothProvider registers a GothProvider
func RegisterProviderWithGothic ¶
RegisterProviderWithGothic register a OAuth2 provider in goth lib
Types ¶
type Attribute ¶
Attribute describes the availability, and required status for a custom url configuration
type AuthSourceProvider ¶
type AuthSourceProvider struct {
GothProvider
// contains filtered or unexported fields
}
AuthSourceProvider provides a provider for an AuthSource. Multiple auth sources could use the same registered GothProvider So each auth source should have its own DisplayName and IconHTML for display. The Name is the GothProvider's name, to help to find the GothProvider to sign in. The DisplayName is the auth source config's name, site admin set it on the admin page, the IconURL can also be set there.
func (*AuthSourceProvider) DisplayName ¶
func (p *AuthSourceProvider) DisplayName() string
func (*AuthSourceProvider) IconHTML ¶
func (p *AuthSourceProvider) IconHTML(size int) template.HTML