oauth2

package
v0.0.0-...-3208bda Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitOAuth2Manager

func InitOAuth2Manager()

系统启动时初始化OAuth2服务

Types

type OAuth2

type OAuth2 interface {
	Authorize(code string) OAuthResult // 根据微信返回的accessTokenCode开始鉴权并获取用户信息
	// contains filtered or unexported methods
}

OAuth2服务的通用鉴权接口

type OAuthResult

type OAuthResult struct {
	Result   bool
	UserInfo *OAuthUserInfo
}

OAuth鉴权结果

type OAuthUserInfo

type OAuthUserInfo struct {
	AccessToken string
	OpenId      string
	UnionId     string
	NickName    string
	Gender      int
	AvatarUrl   string
}

OAuth授权获取的用户信息

type QQOAuth

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

实现QQOAuth2鉴权

func (*QQOAuth) Authorize

func (oauth *QQOAuth) Authorize(code string) OAuthResult

type WechatOAuth

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

实现 微信 OAuth2鉴权

var WechatOAuth2Manager WechatOAuth

func (*WechatOAuth) Authorize

func (oauth *WechatOAuth) Authorize(code string) OAuthResult

type WeiboOAuth

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

实现微博 OAuth2鉴权

func (*WeiboOAuth) Authorize

func (oauth *WeiboOAuth) Authorize(code string) OAuthResult

Jump to

Keyboard shortcuts

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