public class StravaClient extends BaseOAuth20Client<StravaProfile>
OAuth20Client for Strava.
Use the key as the client_id and secret as the client_secret, both provided by Strava at: https://www.strava.com/settings/api
Set approvalPrompt to "force" if you want to force the authorization dialog to always display on Strava, otherwise let it to "auto" (default value).
More info at: http://strava.github.io/api/
| Modifier and Type | Field and Description |
|---|---|
protected String |
scope
comma delimited string of ‘view_private’ and/or ‘write’, leave blank for read-only permissions.
|
logger, OAUTH_CODEconnectTimeout, key, proxyHost, proxyPort, readTimeout, secret, service, tokenAsHeaderATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, NEEDS_CLIENT_REDIRECTION_PARAMETER| Constructor and Description |
|---|
StravaClient() |
StravaClient(String key,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected StravaProfile |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
String |
getApprovalPrompt() |
protected String |
getProfileUrl(org.scribe.model.Token accessToken)
Retrieve the url of the profile of the authenticated user for the provider.
|
String |
getScope() |
protected boolean |
hasBeenCancelled(WebContext context)
Return if the authentication has been cancelled.
|
protected void |
internalInit() |
protected boolean |
isDirectRedirection() |
protected StravaClient |
newClient() |
protected boolean |
requiresStateParameter()
Return if this client requires a state parameter.
|
void |
setApprovalPrompt(String approvalPrompt) |
void |
setScope(String scope) |
getAccessToken, getOAuthCredentials, getStateParameter, retrieveAuthorizationUrladdAccessTokenToProfile, clone, createProxyRequest, getConnectTimeout, getKey, getMechanism, getProxyHost, getProxyPort, getReadTimeout, getSecret, getUserProfile, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, sendRequestForData, setConnectTimeout, setKey, setProxyHost, setProxyPort, setReadTimeout, setSecret, setTokenAsHeaderaddAuthorizationGenerator, getAuthenticator, getAuthorizationGenerators, getCallbackUrl, getContextualCallbackUrl, getCredentials, getName, getProfileCreator, getRedirectAction, getRedirectionUrl, getUserProfile, isEnableContextualRedirects, isIncludeClientNameInCallbackUrl, prependHostToUrlIfNotPresent, redirect, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setCallbackUrl, setEnableContextualRedirects, setIncludeClientNameInCallbackUrl, setName, setProfileCreator, toStringinit, reinitprotected String scope
public String getApprovalPrompt()
public void setApprovalPrompt(String approvalPrompt)
public String getScope()
public void setScope(String scope)
protected StravaClient newClient()
newClient in class BaseClient<OAuthCredentials,StravaProfile>protected void internalInit()
internalInit in class BaseOAuthClient<StravaProfile>protected boolean requiresStateParameter()
BaseOAuth20ClientrequiresStateParameter in class BaseOAuth20Client<StravaProfile>protected boolean hasBeenCancelled(WebContext context)
BaseOAuthClienthasBeenCancelled in class BaseOAuthClient<StravaProfile>context - the web context.protected String getProfileUrl(org.scribe.model.Token accessToken)
BaseOAuthClientgetProfileUrl in class BaseOAuthClient<StravaProfile>accessToken - only used when constructing dynamic urls from data in the tokenprotected StravaProfile extractUserProfile(String body)
BaseOAuthClientextractUserProfile in class BaseOAuthClient<StravaProfile>body - the response bodyprotected boolean isDirectRedirection()
isDirectRedirection in class BaseOAuth20Client<StravaProfile>Copyright © 2015. All Rights Reserved.