Documentation
¶
Index ¶
- Constants
- func GetComponentAccessToken(appid, appsecret, verityTicket string) (token string, expiresIn int, err error)
- func GetComponentBindURL(appid, preAuthCode, redirectURL string, authType AuthType, bizAppID string) string
- func GetComponentLoginPageURL(appid, preAuthCode, redirectURL string, authType AuthType) string
- func ParseAuthorizationCode(r *http.Request) (code string, expiresIn int, err error)
- type AuthType
- type AuthorizationInfo
- type AuthorizerInfo
- type AuthorizerObj
- type AuthorizerToken
- type FuncInfo
- type PreAuthCode
- type QueryAuth
- type Scope
- type VerifyTicket
Constants ¶
View Source
const ( AuthTypeMP = 1 AuthTypeWeapp = 2 AuthTypeAll = 3 )
表示几种验证类型
Variables ¶
This section is empty.
Functions ¶
func GetComponentAccessToken ¶
func GetComponentAccessToken(appid, appsecret, verityTicket string) (token string, expiresIn int, err error)
GetComponentAccessToken 获取第三方平台 component_access_token
func GetComponentBindURL ¶
func GetComponentBindURL(appid, preAuthCode, redirectURL string, authType AuthType, bizAppID string) string
GetComponentBindURL 生成授权链接
func GetComponentLoginPageURL ¶
GetComponentLoginPageURL 生成授权引导页网址
Types ¶
type AuthorizationInfo ¶
type AuthorizerInfo ¶
type AuthorizerObj ¶
type AuthorizerObj struct {
Info *AuthorizerInfo `json:"authorizer_info"`
}
func GetAuthorizerInfo ¶
func GetAuthorizerInfo(appid, authorizerAppid, componentAccessToken string) (*AuthorizerObj, error)
GetAuthorizerInfo 获取授权方的公众号帐号基本信息
type AuthorizerToken ¶
type AuthorizerToken struct { AccessToken string `json:"authorizer_access_token"` // 授权方令牌 ExpiresIn int `json:"expires_in"` // 有效期,为2小时 RefreshToken string `json:"authorizer_refresh_token"` // 刷新令牌 }
func GetAuthorizerToken ¶
func GetAuthorizerToken(appid, authorizerAppid, authorizerRefreshToken, componentAccessToken string) (*AuthorizerToken, error)
GetAuthorizerToken 获取(刷新)授权公众号的接口调用凭据(令牌)
type PreAuthCode ¶
PreAuthCode 从预授权地址返回的内容
func GetPreAuthCode ¶
func GetPreAuthCode(appid, accessToken string) (*PreAuthCode, error)
GetPreAuthCode 获取预授权码
type QueryAuth ¶
type QueryAuth struct {
AuthorizationInfo *AuthorizationInfo `json:"authorization_info"`
}
func GetQueryAuth ¶
GetQueryAuth 使用授权码换取公众号的接口调用凭据和授权信息
type VerifyTicket ¶
type VerifyTicket struct { Root xml.Name `xml:"xml"` AppID string `xml:"AppId"` CreateTime string `xml:"CreateTime"` InfoType string `xml:"InfoType"` ComponentVerifyTicket string `xml:"ComponentVerifyTicket"` }
VerifyTicket 返回的验证信息
func ParseVerifyTicket ¶
func ParseVerifyTicket(c *crypto.Crypto, w http.ResponseWriter, r *http.Request) (*VerifyTicket, error)
ParseVerifyTicket 处理 component_verify_ticket 事件中返回的数据
Click to show internal directories.
Click to hide internal directories.