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
service
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver
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.
|
protected com.github.scribejava.core.builder.api.BaseApi<com.github.scribejava.core.oauth.OAuth20Service> |
getApi()
Define the OAuth API for this client.
|
String |
getApprovalPrompt() |
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.
|
String |
getScope() |
void |
setApprovalPrompt(String approvalPrompt) |
void |
setScope(String scope) |
addAccessTokenToProfile, getAccessToken, getOAuthCredentials, retrieveAuthorizationUrl, signRequest
buildOAuthConfig, createOAuthRequest, getConnectTimeout, getKey, getReadTimeout, getResponseType, getSecret, hasBeenCancelled, hasOAuthGrantType, internalInit, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, setConnectTimeout, setKey, setReadTimeout, setResponseType, setSecret, setTokenAsHeader
computeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrl
addAuthorizationGenerator, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName, toString
init, reinit
protected String scope
protected com.github.scribejava.core.builder.api.BaseApi<com.github.scribejava.core.oauth.OAuth20Service> getApi()
BaseOAuthClient
getApi
in class BaseOAuthClient<StravaProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
protected String getOAuthScope()
BaseOAuthClient
getOAuthScope
in class BaseOAuthClient<StravaProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
protected String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken)
BaseOAuthClient
getProfileUrl
in class BaseOAuthClient<StravaProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
accessToken
- only used when constructing dynamic urls from data in the tokenprotected StravaProfile extractUserProfile(String body) throws HttpAction
BaseOAuthClient
extractUserProfile
in class BaseOAuthClient<StravaProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
body
- the response bodyHttpAction
- whether an additional HTTP action is requiredpublic String getApprovalPrompt()
public void setApprovalPrompt(String approvalPrompt)
public String getScope()
public void setScope(String scope)
Copyright © 2016. All rights reserved.