public class AuthWeChatEnterpriseThirdQrcodeRequest extends AbstractAuthWeChatEnterpriseRequest
企业微信第三方二维码登录
authStateCache, config, source
Constructor and Description |
---|
AuthWeChatEnterpriseThirdQrcodeRequest(AuthConfig config) |
AuthWeChatEnterpriseThirdQrcodeRequest(AuthConfig config,
AuthStateCache authStateCache) |
Modifier and Type | Method and Description |
---|---|
protected String |
accessTokenUrl()
获取token的URL
|
String |
authorize(String state)
返回带
state 参数的授权url,授权回调时会带上这个state |
protected String |
doGetAuthorizationCode(String code)
通用的 authorizationCode 协议
|
protected String |
doGetUserInfo(AuthToken authToken)
通用的 用户信息
|
protected AuthToken |
getAccessToken(AuthCallback authCallback)
获取access token
|
protected AuthUser |
getUserInfo(AuthToken authToken)
使用token换取用户信息
|
AuthResponse |
login(AuthCallback authCallback)
统一的登录入口。当通过
AuthDefaultRequest.authorize(String) 授权成功后,会跳转到调用方的相关回调方法中
方法的入参可以使用AuthCallback ,AuthCallback 类中封装好了OAuth2授权回调所需要的参数 |
protected String |
userInfoUrl(AuthToken authToken)
返回获取userInfo的url
|
accessTokenUrl
authorize, doGetRevoke, doPostAuthorizationCode, doPostRevoke, doPostUserInfo, getRealState, getScopes, refreshTokenUrl, revokeUrl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
refresh, revoke
public AuthWeChatEnterpriseThirdQrcodeRequest(AuthConfig config)
public AuthWeChatEnterpriseThirdQrcodeRequest(AuthConfig config, AuthStateCache authStateCache)
public String authorize(String state)
AuthDefaultRequest
state
参数的授权url,授权回调时会带上这个state
authorize
in interface AuthRequest
authorize
in class AuthDefaultRequest
state
- state 验证授权流程的参数,可以防止csrfpublic AuthResponse login(AuthCallback authCallback)
AuthDefaultRequest
AuthDefaultRequest.authorize(String)
授权成功后,会跳转到调用方的相关回调方法中
方法的入参可以使用AuthCallback
,AuthCallback
类中封装好了OAuth2授权回调所需要的参数login
in interface AuthRequest
login
in class AuthDefaultRequest
authCallback
- 用于接收回调参数的实体protected AuthToken getAccessToken(AuthCallback authCallback)
AuthDefaultRequest
getAccessToken
in class AbstractAuthWeChatEnterpriseRequest
authCallback
- 授权成功后的回调参数AuthDefaultRequest.authorize()
,
AuthDefaultRequest.authorize(String)
protected String doGetAuthorizationCode(String code)
AuthDefaultRequest
doGetAuthorizationCode
in class AuthDefaultRequest
code
- code码protected String accessTokenUrl()
protected AuthUser getUserInfo(AuthToken authToken)
AuthDefaultRequest
getUserInfo
in class AbstractAuthWeChatEnterpriseRequest
authToken
- token信息AuthDefaultRequest.getAccessToken(AuthCallback)
protected String doGetUserInfo(AuthToken authToken)
AuthDefaultRequest
doGetUserInfo
in class AuthDefaultRequest
authToken
- token封装protected String userInfoUrl(AuthToken authToken)
AbstractAuthWeChatEnterpriseRequest
userInfoUrl
in class AbstractAuthWeChatEnterpriseRequest
authToken
- 用户授权后的tokenCopyright © 2021. All rights reserved.