Documentation ¶
Index ¶
- Variables
- func NewManager(config *Config) (*manage.Manager, error)
- func NewServer(config *Config) (*server.Server, error)
- type Config
- type HandlerInfo
- type OptionsSetter
- func ClientStore(store oauth2.ClientStore) OptionsSetter
- func JWTKey(key []byte) OptionsSetter
- func JWTKeyID(keyID string) OptionsSetter
- func JWTMethod(method jwt.SigningMethod) OptionsSetter
- func SetHandler(handlerInfo *HandlerInfo) OptionsSetter
- func SetStore(store oauth2.TokenStore) OptionsSetter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RequestFormDataCacheKey = `oauth2RequestForm` PasswordAuthorizationHandler = func(ctx context.Context, username, password string) (userID string, err error) { return } UserAuthorizeHandler = func(w http.ResponseWriter, r *http.Request) (userID string, err error) { ctx := r.Context().(echo.Context) v := ctx.Session().Get(`uid`) if v == nil { ctx.Session().Set(RequestFormDataCacheKey, ctx.Forms()) err = ctx.Redirect(`/oauth2/login`) return } userID = v.(string) return } InternalErrorHandler = func(err error) (re *errors.Response) { return } ResponseErrorHandler = func(re *errors.Response) { } )
View Source
var Default = NewConfig()
Functions ¶
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 (*Config) Init ¶
func (c *Config) Init(options ...OptionsSetter) error
func (*Config) InitConfig ¶
func (c *Config) InitConfig(options ...OptionsSetter) *Config
type HandlerInfo ¶
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
|
|
Click to show internal directories.
Click to hide internal directories.