public class TwitterClient extends BaseOAuth10Client<TwitterProfile>
This class is the OAuth client to authenticate users in Twitter.
You can define if a screen should always been displayed for authorization confirmation by using the
setAlwaysConfirmAuthorization(boolean) method (false by default).
It returns a TwitterProfile.
More information at https://dev.twitter.com/docs/api/1/get/account/verify_credentials
TwitterProfilelogger, OAUTH_TOKEN, OAUTH_VERIFIER, REQUEST_TOKENconnectTimeout, key, proxyHost, proxyPort, readTimeout, secret, service, tokenAsHeaderATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, NEEDS_CLIENT_REDIRECTION_PARAMETER| Constructor and Description |
|---|
TwitterClient() |
TwitterClient(String key,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected TwitterProfile |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
protected String |
getProfileUrl(org.scribe.model.Token accessToken)
Retrieve the url of the profile of the authenticated user for the provider.
|
protected boolean |
hasBeenCancelled(WebContext context)
Return if the authentication has been cancelled.
|
protected void |
internalInit(WebContext context) |
boolean |
isAlwaysConfirmAuthorization() |
protected TwitterClient |
newClient() |
void |
setAlwaysConfirmAuthorization(boolean alwaysConfirmAuthorization) |
addAccessTokenToProfile, getAccessToken, getOAuthCredentials, getRequestTokenSessionAttributeName, isDirectRedirection, retrieveAuthorizationUrlclone, createProxyRequest, getClientType, getConnectTimeout, getKey, getProxyHost, getProxyPort, getReadTimeout, getSecret, getUserProfile, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, sendRequestForData, setConnectTimeout, setKey, setProxyHost, setProxyPort, setReadTimeout, setSecret, setTokenAsHeadercomputeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getRedirectionUrl, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrladdAuthorizationGenerator, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName, toStringinit, reinitprotected TwitterClient newClient()
newClient in class BaseClient<OAuthCredentials,TwitterProfile>protected void internalInit(WebContext context)
internalInit in class BaseOAuthClient<TwitterProfile>protected String getProfileUrl(org.scribe.model.Token accessToken)
BaseOAuthClientgetProfileUrl in class BaseOAuthClient<TwitterProfile>accessToken - only used when constructing dynamic urls from data in the tokenprotected boolean hasBeenCancelled(WebContext context)
BaseOAuthClienthasBeenCancelled in class BaseOAuthClient<TwitterProfile>context - the web context.protected TwitterProfile extractUserProfile(String body)
BaseOAuthClientextractUserProfile in class BaseOAuthClient<TwitterProfile>body - the response bodypublic boolean isAlwaysConfirmAuthorization()
public void setAlwaysConfirmAuthorization(boolean alwaysConfirmAuthorization)
Copyright © 2016. All Rights Reserved.