oauth2

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthCodeURL

func AuthCodeURL(appId, redirectURI, scope, state string) string

Types

type UserInfo

type UserInfo struct {
	UserId string `json:"UserId"` // 成员UserID。若需要获得用户详情信息,可调用通讯录接口:读取成员
	OpenId string `json:"OpenId"` // 非企业成员的标识,对当前企业唯一
}

func GetUserInfo

func GetUserInfo(accessToken, code string, httpClient *http.Client) (info *UserInfo, err error)

GetUserInfo 获取用户信息.

accessToken: 网页授权接口调用凭证
code:     通过成员授权获取到的code,最大为512字节。每次成员授权带上的code将不一样,code只能使用一次,5分钟未被使用自动过期。
httpClient:  如果不指定则默认为 util.DefaultHttpClient

Jump to

Keyboard shortcuts

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