oauth2

package
v3.1.61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: MIT, MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderHeaderKey = "gitea-oauth2-provider"

ProviderHeaderKey is the HTTP header key

Variables

View Source
var ErrAuthSourceNotActivated = errors.New("auth source is not activated")

Functions

func ClearProviders

func ClearProviders()

ClearProviders clears all OAuth2 providers from the goth lib

func Init

func Init(ctx context.Context) error

Init initializes the oauth source

func IsErrOpenIDConnectInitialize

func IsErrOpenIDConnectInitialize(err error) bool

IsErrOpenIDConnectInitialize checks if an error is a ExternalLoginUserAlreadyExist.

func RegisterGothProvider

func RegisterGothProvider(provider GothProvider)

RegisterGothProvider registers a GothProvider

func RegisterProviderWithGothic

func RegisterProviderWithGothic(providerName string, source *Source) error

RegisterProviderWithGothic register a OAuth2 provider in goth lib

func RemoveProviderFromGothic

func RemoveProviderFromGothic(providerName