public class AuthTwitterRequest extends AuthDefaultRequest
authStateCache, config, source
Constructor and Description |
---|
AuthTwitterRequest(AuthConfig config) |
AuthTwitterRequest(AuthConfig config,
AuthStateCache authStateCache) |
Modifier and Type | Method and Description |
---|---|
String |
authorize(String state)
返回带
state 参数的授权url,授权回调时会带上这个state |
protected AuthToken |
getAccessToken(AuthCallback authCallback)
Convert request token to access token
https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with-twitter/guides/implementing-sign-in-with-twitter
|
AuthToken |
getRequestToken()
Obtaining a request token
https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with-twitter/guides/implementing-sign-in-with-twitter
|
protected AuthUser |
getUserInfo(AuthToken authToken)
使用token换取用户信息
|
protected String |
userInfoUrl(AuthToken authToken)
返回获取userInfo的url
|
accessTokenUrl, authorize, doGetAuthorizationCode, doGetRevoke, doGetUserInfo, doPostAuthorizationCode, doPostRevoke, doPostUserInfo, getRealState, getScopes, login, refreshTokenUrl, revokeUrl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
refresh, revoke
public AuthTwitterRequest(AuthConfig config)
public AuthTwitterRequest(AuthConfig config, AuthStateCache authStateCache)
public String authorize(String state)
state
参数的授权url,授权回调时会带上这个state
authorize
in interface AuthRequest
authorize
in class AuthDefaultRequest
state
- state 验证授权流程的参数,可以防止csrfpublic AuthToken getRequestToken()
protected AuthToken getAccessToken(AuthCallback authCallback)
getAccessToken
in class AuthDefaultRequest
authCallback
- 授权成功后的回调参数AuthDefaultRequest.authorize()
,
AuthDefaultRequest.authorize(String)
protected AuthUser getUserInfo(AuthToken authToken)
AuthDefaultRequest
getUserInfo
in class AuthDefaultRequest
authToken
- token信息AuthDefaultRequest.getAccessToken(AuthCallback)
protected String userInfoUrl(AuthToken authToken)
AuthDefaultRequest
userInfoUrl
in class AuthDefaultRequest
authToken
- tokenCopyright © 2021. All rights reserved.