oauth2

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Container = &OAuth2Container{}
)

Initialize a OAuth 2.0 container singleton instance

Functions

func GetExternalUserAuthType

func GetExternalUserAuthType() core.UserExternalAuthType

GetExternalUserAuthType returns the external user auth type of the current OAuth 2.0 provider

func GetOAuth2AuthUrl

func GetOAuth2AuthUrl(c core.Context, state string, verifier string) (string, error)

GetOAuth2AuthUrl returns the OAuth 2.0 authentication url

func GetOAuth2Token

func GetOAuth2Token(c core.Context, code string, verifier string) (*oauth2.Token, error)

GetOAuth2Token exchanges the authorization code for an OAuth 2.0 token

func GetOAuth2UserInfo

func GetOAuth2UserInfo(c core.Context, token *oauth2.Token) (*data.OAuth2UserInfo, error)

GetOAuth2UserInfo retrieves the OAuth 2.0 user info using the provided OAuth 2.0 token

func InitializeOAuth2Provider

func InitializeOAuth2Provider(config *settings.Config) error

InitializeOAuth2Provider initializes the current OAuth 2.0 provider according to the config

Types

type OAuth2Container

type OAuth2Container struct {
	// contains filtered or unexported fields
}

OAuth2Container contains the current OAuth 2.0 authentication provider

type OAuth2Context

type OAuth2Context struct {
	core.Context
	// contains filtered or unexported fields
}

OAuth2Context represents the context for OAuth 2.0 operations

func (*OAuth2Context) Value

func (c *OAuth2Context) Value(key any) any

Value returns the value associated with key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL