Package org.pac4j.oauth.profile.strava
Class StravaProfileDefinition
- java.lang.Object
-
- org.pac4j.core.profile.definition.ProfileDefinition
-
- org.pac4j.core.profile.definition.CommonProfileDefinition
-
- org.pac4j.oauth.profile.definition.OAuthProfileDefinition
-
- org.pac4j.oauth.profile.strava.StravaProfileDefinition
-
public class StravaProfileDefinition extends OAuthProfileDefinition
This class is the Strava profile definition.- Since:
- 1.7.0
- Author:
- Adrian Papusoi
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBADGE_TYPE_IDstatic java.lang.StringBIKESstatic java.lang.StringCITYstatic java.lang.StringCLUBSstatic java.lang.StringCOUNTRYstatic java.lang.StringCREATED_ATstatic java.lang.StringDATE_PREFERENCEstatic java.lang.StringFIRST_NAMEstatic java.lang.StringFOLLOWER_COUNTstatic java.lang.StringFRIEND_COUNTstatic java.lang.StringIDstatic java.lang.StringLAST_NAMEstatic java.lang.StringMEASUREMENT_PREFERENCEstatic java.lang.StringPREMIUMstatic java.lang.StringPROFILEstatic java.lang.StringPROFILE_MEDIUMstatic java.lang.StringRESOURCE_STATEstatic java.lang.StringSEXstatic java.lang.StringSHOESstatic java.lang.StringSTATEstatic java.lang.StringUPDATED_AT
-
Constructor Summary
Constructors Constructor Description StravaProfileDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StravaProfileextractUserProfile(java.lang.String body)Extract the user profile from the response (JSON, XML...) of the profile url.java.lang.StringgetProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration)Retrieve the url of the profile of the authenticated user for the provider.-
Methods inherited from class org.pac4j.oauth.profile.definition.OAuthProfileDefinition
getProfileVerb, raiseProfileExtractionError, raiseProfileExtractionJsonError, raiseProfileExtractionJsonError
-
Methods inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
configurePrimaryAttributes
-
Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinition
convertAndAdd, convertAndAdd, getConverters, getParameter, getPrimaryAttributes, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
RESOURCE_STATE
public static final java.lang.String RESOURCE_STATE
- See Also:
- Constant Field Values
-
FIRST_NAME
public static final java.lang.String FIRST_NAME
- See Also:
- Constant Field Values
-
LAST_NAME
public static final java.lang.String LAST_NAME
- See Also:
- Constant Field Values
-
PROFILE_MEDIUM
public static final java.lang.String PROFILE_MEDIUM
- See Also:
- Constant Field Values
-
PROFILE
public static final java.lang.String PROFILE
- See Also:
- Constant Field Values
-
CITY
public static final java.lang.String CITY
- See Also:
- Constant Field Values
-
STATE
public static final java.lang.String STATE
- See Also:
- Constant Field Values
-
COUNTRY
public static final java.lang.String COUNTRY
- See Also:
- Constant Field Values
-
SEX
public static final java.lang.String SEX
- See Also:
- Constant Field Values
-
PREMIUM
public static final java.lang.String PREMIUM
- See Also:
- Constant Field Values
-
CREATED_AT
public static final java.lang.String CREATED_AT
- See Also:
- Constant Field Values
-
UPDATED_AT
public static final java.lang.String UPDATED_AT
- See Also:
- Constant Field Values
-
BADGE_TYPE_ID
public static final java.lang.String BADGE_TYPE_ID
- See Also:
- Constant Field Values
-
FOLLOWER_COUNT
public static final java.lang.String FOLLOWER_COUNT
- See Also:
- Constant Field Values
-
FRIEND_COUNT
public static final java.lang.String FRIEND_COUNT
- See Also:
- Constant Field Values
-
DATE_PREFERENCE
public static final java.lang.String DATE_PREFERENCE
- See Also:
- Constant Field Values
-
MEASUREMENT_PREFERENCE
public static final java.lang.String MEASUREMENT_PREFERENCE
- See Also:
- Constant Field Values
-
CLUBS
public static final java.lang.String CLUBS
- See Also:
- Constant Field Values
-
BIKES
public static final java.lang.String BIKES
- See Also:
- Constant Field Values
-
SHOES
public static final java.lang.String SHOES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProfileUrl
public java.lang.String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration)Description copied from class:OAuthProfileDefinitionRetrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrlin classOAuthProfileDefinition- Parameters:
accessToken- only used when constructing dynamic urls from data in the tokenconfiguration- the current configuration- Returns:
- the url of the user profile given by the provider
-
extractUserProfile
public StravaProfile extractUserProfile(java.lang.String body)
Description copied from class:OAuthProfileDefinitionExtract the user profile from the response (JSON, XML...) of the profile url.- Specified by:
extractUserProfilein classOAuthProfileDefinition- Parameters:
body- the response body- Returns:
- the returned profile
-
-