oauth2s

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

README

oauth2s

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestFormDataCacheKey = `oauth2RequestForm`

	InternalErrorHandler server.InternalErrorHandler = func(err error) (re *errors.Response) {
		return
	}

	ResponseErrorHandler server.ResponseErrorHandler = func(re *errors.Response) {
	}
)
View Source
var Default = NewConfig()

Functions

func NewManager

func NewManager(config *Config) (*manage.Manager, error)

func NewServer

func NewServer(config *Config) (*server.Server, error)

Types

type Config

type Config struct {
	JWTKeyID    string
	JWTKey      []byte
	JWTMethod   jwt.SigningMethod
	Store       oauth2.TokenStore
	ClientStore oauth2.ClientStore
	HandlerInfo *HandlerInfo
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (*Config) Init

func (c *Config) Init(options ...OptionsSetter) error

func (*Config) InitConfig

func (c *Config) InitConfig(options ...OptionsSetter) *Config

func (*Config) Manager

func (c *Config) Manager() *manage.Manager

func (*Config) Server

func (c *Config) Server() *server.Server

type HandlerInfo

type HandlerInfo struct {
	PasswordAuthorization server.PasswordAuthorizationHandler
	UserAuthorize         server.UserAuthorizationHandler
	InternalError         server.InternalErrorHandler
	ResponseError         server.ResponseErrorHandler
	RefreshingScope       server.RefreshingScopeHandler
	RefreshingValidation  server.RefreshingValidationHandler
}

type OptionsSetter

type OptionsSetter func(*Config)

func ClientStore

func ClientStore(store oauth2.ClientStore) OptionsSetter

func JWTKey

func JWTKey(key []byte) OptionsSetter

func JWTKeyID

func JWTKeyID(keyID string) OptionsSetter

func JWTMethod

func JWTMethod(method jwt.SigningMethod) OptionsSetter

func SetHandler

func SetHandler(handlerInfo *HandlerInfo) OptionsSetter

func SetStore

func SetStore(store oauth2.TokenStore) OptionsSetter

Directories

Path Synopsis
client
goth/providers/alipay
Package alipay implements the OAuth2 protocol for authenticating users through Alipay.
Package alipay implements the OAuth2 protocol for authenticating users through Alipay.
goth/providers/qq
Package qq implements the OAuth2 protocol for authenticating users through QQ.
Package qq implements the OAuth2 protocol for authenticating users through QQ.
goth/providers/wechat
Package wechat implements the OAuth2 protocol for authenticating users through Wechat.
Package wechat implements the OAuth2 protocol for authenticating users through Wechat.
goth/providers/weibo
Package weibo implements the OAuth2 protocol for authenticating users through Weibo.
Package weibo implements the OAuth2 protocol for authenticating users through Weibo.
store

Jump to

Keyboard shortcuts

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