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
This class is the Strava profile definition.
- Since:
- 1.7.0
- Author:
- Adrian Papusoi
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantBADGE_TYPE_ID="badge_type_id"static final StringConstantBIKES="bikes"static final StringConstantCITY="city"static final StringConstantCLUBS="clubs"static final StringConstantCOUNTRY="country"static final StringConstantCREATED_AT="created_at"static final StringConstantDATE_PREFERENCE="date_preference"static final StringConstantFIRST_NAME="firstname"static final StringConstantFOLLOWER_COUNT="follower_count"static final StringConstantFRIEND_COUNT="friend_count"static final StringConstantID="id"static final StringConstantLAST_NAME="lastname"static final StringConstantMEASUREMENT_PREFERENCE="measurement_preference"static final StringConstantPREMIUM="premium"static final StringConstantPROFILE="profile"static final StringConstantPROFILE_MEDIUM="profile_medium"static final StringConstantRESOURCE_STATE="resource_state"static final StringConstantSEX="sex"static final StringConstantSHOES="shoes"static final StringConstantSTATE="state"static final StringConstantUPDATED_AT="updated_at"Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
DISPLAY_NAME, EMAIL, FAMILY_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URLFields inherited from class org.pac4j.core.profile.definition.ProfileDefinition
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractUserProfile(String body) Extract the user profile from the response (JSON, XML...) of the profile url.getProfileUrl(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, raiseProfileExtractionJsonErrorMethods inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
configurePrimaryAttributesMethods inherited from class org.pac4j.core.profile.definition.ProfileDefinition
convertAndAdd, convertAndAdd, getConverters, getLogger, getParameter, getPrimaryAttributes, getProfileFactory, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
Field Details
-
ID
ConstantID="id"- See Also:
-
RESOURCE_STATE
ConstantRESOURCE_STATE="resource_state"- See Also:
-
FIRST_NAME
ConstantFIRST_NAME="firstname"- See Also:
-
LAST_NAME
ConstantLAST_NAME="lastname"- See Also:
-
PROFILE_MEDIUM
ConstantPROFILE_MEDIUM="profile_medium"- See Also:
-
PROFILE
ConstantPROFILE="profile"- See Also:
-
CITY
ConstantCITY="city"- See Also:
-
STATE
ConstantSTATE="state"- See Also:
-
COUNTRY
ConstantCOUNTRY="country"- See Also:
-
SEX
ConstantSEX="sex"- See Also:
-
PREMIUM
ConstantPREMIUM="premium"- See Also:
-
CREATED_AT
ConstantCREATED_AT="created_at"- See Also:
-
UPDATED_AT
ConstantUPDATED_AT="updated_at"- See Also:
-
BADGE_TYPE_ID
ConstantBADGE_TYPE_ID="badge_type_id"- See Also:
-
FOLLOWER_COUNT
ConstantFOLLOWER_COUNT="follower_count"- See Also:
-
FRIEND_COUNT
ConstantFRIEND_COUNT="friend_count"- See Also:
-
DATE_PREFERENCE
ConstantDATE_PREFERENCE="date_preference"- See Also:
-
MEASUREMENT_PREFERENCE
ConstantMEASUREMENT_PREFERENCE="measurement_preference"- See Also:
-
CLUBS
ConstantCLUBS="clubs"- See Also:
-
BIKES
ConstantBIKES="bikes"- See Also:
-
SHOES
ConstantSHOES="shoes"- See Also:
-
-
Constructor Details
-
StravaProfileDefinition
public StravaProfileDefinition()Constructor for StravaProfileDefinition.
-
-
Method Details
-
getProfileUrl
public String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration) Retrieve 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
Extract 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
-