public abstract class AbstractAuthMicrosoftRequest extends AuthDefaultRequest
authStateCache, config, source| 构造器和说明 |
|---|
AbstractAuthMicrosoftRequest(AuthConfig config,
AuthSource source) |
AbstractAuthMicrosoftRequest(AuthConfig config,
AuthSource source,
AuthStateCache authStateCache) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
accessTokenUrl(String code)
返回获取accessToken的url
|
String |
authorize(String state)
返回带
state参数的授权url,授权回调时会带上这个state |
private void |
checkResponse(com.alibaba.fastjson.JSONObject object)
检查响应内容是否正确
|
protected AuthToken |
getAccessToken(AuthCallback authCallback)
获取access token
|
private AuthToken |
getToken(String accessTokenUrl)
获取token,适用于获取access_token和刷新token
|
protected AuthUser |
getUserInfo(AuthToken authToken)
使用token换取用户信息
|
AuthResponse |
refresh(AuthToken authToken)
刷新access token (续期)
|
protected String |
refreshTokenUrl(String refreshToken)
返回获取accessToken的url
|
protected String |
userInfoUrl(AuthToken authToken)
返回获取userInfo的url
|
authorize, authToken, checkCode, copyConfig, doGetAuthorizationCode, doGetRevoke, doGetUserInfo, doPostAuthorizationCode, doPostRevoke, doPostUserInfo, getRealState, getScopes, login, responseError, revokeUrl, userInfoclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrevokepublic AbstractAuthMicrosoftRequest(AuthConfig config, AuthSource source)
public AbstractAuthMicrosoftRequest(AuthConfig config, AuthSource source, AuthStateCache authStateCache)
protected AuthToken getAccessToken(AuthCallback authCallback)
AuthDefaultRequestgetAccessToken 在类中 AuthDefaultRequestauthCallback - 授权成功后的回调参数AuthDefaultRequest.authorize(),
AuthDefaultRequest.authorize(String)private AuthToken getToken(String accessTokenUrl)
accessTokenUrl - 实际请求token的地址private void checkResponse(com.alibaba.fastjson.JSONObject object)
object - 请求响应内容protected AuthUser getUserInfo(AuthToken authToken)
AuthDefaultRequestgetUserInfo 在类中 AuthDefaultRequestauthToken - token信息AuthDefaultRequest.getAccessToken(AuthCallback)public AuthResponse refresh(AuthToken authToken)
authToken - 登录成功后返回的Token信息public String authorize(String state)
state参数的授权url,授权回调时会带上这个stateauthorize 在接口中 AuthRequestauthorize 在类中 AuthDefaultRequeststate - state 验证授权流程的参数,可以防止csrfprotected String accessTokenUrl(String code)
accessTokenUrl 在类中 AuthDefaultRequestcode - 授权codeprotected String userInfoUrl(AuthToken authToken)
userInfoUrl 在类中 AuthDefaultRequestauthToken - 用户授权后的tokenprotected String refreshTokenUrl(String refreshToken)
refreshTokenUrl 在类中 AuthDefaultRequestrefreshToken - 用户授权后的tokenCopyright © 2023. All rights reserved.