oauth2client

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SuccessHandler    interface{}  = successHandler
	BeginAuthHandler  echo.Handler = echo.HandlerFunc(oauth2.BeginAuthHandler)
	AfterLoginSuccess []func(ctx echo.Context, ouser *goth.User) (end bool, err error)
)

Functions

func Default

func Default() *oauth2.OAuth

func DefaultOAuth

func DefaultOAuth() *oauth2.OAuth

func FireAfterLoginSuccess

func FireAfterLoginSuccess(ctx echo.Context, ouser *goth.User) (end bool, err error)

func GetOAuthAccounts

func GetOAuthAccounts(skipHided ...bool) []oauth2.Account

func InitOauth

func InitOauth(e *echo.Echo, middlewares ...interface{})

InitOauth 第三方登录

func OnAfterLoginSuccess

func OnAfterLoginSuccess(hooks ...func(ctx echo.Context, ouser *goth.User) (end bool, err error))

func OnChangeBackendURL

func OnChangeBackendURL(d config.Diff) error

func OnInstalled

func OnInstalled(ctx echo.Context) error

func RegisterProvider

func RegisterProvider(c *oauth2.Config)

RegisterProvider 注册Provider

func UpdateOAuthAccount

func UpdateOAuthAccount() error

UpdateOAuthAccount 第三方登录平台账号

Types

type OAuth2Config

type OAuth2Config struct {
	On       bool           `json:"on" xml:"on"` // on / off
	Accounts []OAuthAccount `json:"accounts" xml:"accounts"`
}

func (*OAuth2Config) Reload

func (c *OAuth2Config) Reload() error

func (*OAuth2Config) ToAccounts

func (c *OAuth2Config) ToAccounts() []*oauth2.Account

type OAuthAccount

type OAuthAccount struct {
	On     bool   `json:"on" xml:"on"` // on / off
	Name   string `json:"name" xml:"name"`
	AppID  string `json:"appID" xml:"appID"`
	Secret string `json:"secret" xml:"secret"`
	Extra  echo.H `json:"extra" xml:"extra"`
}

func (*OAuthAccount) ToAccount

func (c *OAuthAccount) ToAccount() *oauth2.Account

Jump to

Keyboard shortcuts

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