Documentation
¶
Index ¶
- type Auth
- func (auth *Auth) AuthUrl() string
- func (auth *Auth) GetUserDetail(userTicket string) (*UserDetail, error)
- func (auth *Auth) QrLoginRedirect(writer http.ResponseWriter, request *http.Request, loginType string)
- func (auth *Auth) QrLoginUrl(loginType string) string
- func (auth *Auth) Redirect(writer http.ResponseWriter, request *http.Request)
- func (auth *Auth) TFA() *Tfa
- func (auth *Auth) UserFromCode(code string) (*UserIdentity, error)
- func (auth *Auth) WithAgentId(agentId string) *Auth
- func (auth *Auth) WithRedirectUrl(redirectUrl string) *Auth
- func (auth *Auth) WithScope(scope string) *Auth
- func (auth *Auth) WithState(state string) *Auth
- type Tfa
- type TfaInfo
- type UserDetail
- type UserIdentity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth 企业微信网页授权登录
func NewAuth ¶
func NewAuth(account contracts.AccountInterface) *Auth
func (*Auth) GetUserDetail ¶
func (auth *Auth) GetUserDetail(userTicket string) (*UserDetail, error)
GetUserDetail 获取用户敏感信息
func (*Auth) QrLoginRedirect ¶
func (auth *Auth) QrLoginRedirect(writer http.ResponseWriter, request *http.Request, loginType string)
QrLoginRedirect 302重定向到扫码登录页
func (*Auth) QrLoginUrl ¶
QrLoginUrl 构造企业微信扫码登录链接
func (*Auth) Redirect ¶
func (auth *Auth) Redirect(writer http.ResponseWriter, request *http.Request)
Redirect 302重定向到授权页
func (*Auth) UserFromCode ¶
func (auth *Auth) UserFromCode(code string) (*UserIdentity, error)
UserFromCode 通过code获取用户身份
func (*Auth) WithAgentId ¶
WithAgentId 设置agentid
func (*Auth) WithRedirectUrl ¶
WithRedirectUrl 设置回调URL
type Tfa ¶
type Tfa struct {
// contains filtered or unexported fields
}
Tfa 二次验证
func NewTfa ¶
func NewTfa(account contracts.AccountInterface) *Tfa
func (*Tfa) GetTfaInfo ¶
GetTfaInfo 获取用户二次验证信息(通过code获取userid和tfa_code)
type UserDetail ¶
type UserDetail struct {
UserId string `json:"userid"`
Gender string `json:"gender"`
Avatar string `json:"avatar"`
QrCode string `json:"qr_code"`
Mobile string `json:"mobile"`
Email string `json:"email"`
BizMail string `json:"biz_mail"`
Address string `json:"address"`
}
UserDetail 用户敏感信息
Click to show internal directories.
Click to hide internal directories.