public class FoursquareClient extends BaseOAuth20Client<FoursquareProfile>
This class is the OAuth client to authenticate users in Foursquare.
It returns a FoursquareProfile.
More information at https://developer.foursquare.com/overview/auth.html
logger, OAUTH_CODEserviceATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver| Constructor and Description |
|---|
FoursquareClient() |
FoursquareClient(String key,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected FoursquareProfile |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
protected com.github.scribejava.core.builder.api.BaseApi<com.github.scribejava.core.oauth.OAuth20Service> |
getApi()
Define the OAuth API for this client.
|
protected String |
getOAuthScope()
Define the OAuth scope for this client.
|
protected String |
getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken)
Retrieve the url of the profile of the authenticated user for the provider.
|
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
addAccessTokenToProfile, getAccessToken, getOAuthCredentials, retrieveAuthorizationUrl, signRequestbuildOAuthConfig, createOAuthRequest, getConnectTimeout, getKey, getReadTimeout, getResponseType, getSecret, hasBeenCancelled, hasOAuthGrantType, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, setConnectTimeout, setKey, setReadTimeout, setResponseType, setSecret, setTokenAsHeadercomputeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrladdAuthorizationGenerator, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName, toStringinit, reinitprotected void internalInit(WebContext context)
InitializableWebObjectinternalInit in class BaseOAuthClient<FoursquareProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>context - the web contextprotected com.github.scribejava.core.builder.api.BaseApi<com.github.scribejava.core.oauth.OAuth20Service> getApi()
BaseOAuthClientgetApi in class BaseOAuthClient<FoursquareProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>protected String getOAuthScope()
BaseOAuthClientgetOAuthScope in class BaseOAuthClient<FoursquareProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>protected String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken)
BaseOAuthClientgetProfileUrl in class BaseOAuthClient<FoursquareProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>accessToken - only used when constructing dynamic urls from data in the tokenprotected FoursquareProfile extractUserProfile(String body) throws HttpAction
BaseOAuthClientextractUserProfile in class BaseOAuthClient<FoursquareProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>body - the response bodyHttpAction - whether an additional HTTP action is requiredCopyright © 2016. All rights reserved.