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_CODE
connectTimeout, key, proxyHost, proxyPort, readTimeout, secret, service, tokenAsHeader
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, 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(WebContext context)
Internal initialization of the object.
|
protected boolean |
isDirectRedirection()
Define if this client has a direct redirection.
|
protected StravaClient |
newClient()
Create a new instance of the client.
|
void |
setApprovalPrompt(String approvalPrompt) |
void |
setScope(String scope) |
getAccessToken, getOAuthCredentials, retrieveAuthorizationUrl
addAccessTokenToProfile, clone, createProxyRequest, getClientType, getConnectTimeout, getKey, getProxyHost, getProxyPort, getReadTimeout, getSecret, getUserProfile, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, sendRequestForData, setConnectTimeout, setKey, setProxyHost, setProxyPort, setReadTimeout, setSecret, setTokenAsHeader
computeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getRedirectionUrl, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrl
addAuthorizationGenerator, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName, toString
init, reinit
protected String scope
public String getApprovalPrompt()
public void setApprovalPrompt(String approvalPrompt)
public String getScope()
public void setScope(String scope)
protected StravaClient newClient()
BaseClient
newClient
in class BaseClient<OAuthCredentials,StravaProfile>
protected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class BaseOAuthClient<StravaProfile>
context
- the web contextprotected boolean hasBeenCancelled(WebContext context)
BaseOAuthClient
hasBeenCancelled
in class BaseOAuthClient<StravaProfile>
context
- the web context.protected String getProfileUrl(org.scribe.model.Token accessToken)
BaseOAuthClient
getProfileUrl
in class BaseOAuthClient<StravaProfile>
accessToken
- only used when constructing dynamic urls from data in the tokenprotected StravaProfile extractUserProfile(String body)
BaseOAuthClient
extractUserProfile
in class BaseOAuthClient<StravaProfile>
body
- the response bodyprotected boolean isDirectRedirection()
IndirectClient
isDirectRedirection
in class BaseOAuth20Client<StravaProfile>
Copyright © 2016. All rights reserved.