Documentation ¶
Index ¶
- Constants
- type AuthCenter
- func (a *AuthCenter) GenerateTokens(ctx context.Context, req *auth.GetTokensRequest, rsp *auth.GetTokensResponse) error
- func (a *AuthCenter) RefreshJWTToken(ctx context.Context, req *auth.RefreshJWTRequest, rsp *auth.RefreshJWTResponse) error
- func (a *AuthCenter) VerifyWechatCode(ctx context.Context, req *auth.VerifyWechatCodeRequest, ...) error
- type Code2SessionResp
Constants ¶
View Source
const (
WechatValidationEndpoint = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCenter ¶
type AuthCenter struct{}
WechatAuth ...
func (*AuthCenter) GenerateTokens ¶
func (a *AuthCenter) GenerateTokens(ctx context.Context, req *auth.GetTokensRequest, rsp *auth.GetTokensResponse) error
GenerateTokens ...
func (*AuthCenter) RefreshJWTToken ¶
func (a *AuthCenter) RefreshJWTToken(ctx context.Context, req *auth.RefreshJWTRequest, rsp *auth.RefreshJWTResponse) error
RefreshJWTToken ...
func (*AuthCenter) VerifyWechatCode ¶
func (a *AuthCenter) VerifyWechatCode(ctx context.Context, req *auth.VerifyWechatCodeRequest, rsp *auth.VerifyWechatCodeResponse) error
VerifyWechatCode 校验登录凭证
type Code2SessionResp ¶
type Code2SessionResp struct { OpenID string `json:"openid"` // 用户唯一标识 SessionKey string `json:"session_key"` // 会话密钥 UnionID string `json:"unionid"` // 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回,详见 UnionID 机制说明 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html ErrCode int64 `json:"errcode"` // 错误码 ErrMsg string `json:"errmsg"` // 错误信息 }
Click to show internal directories.
Click to hide internal directories.