Package org.pac4j.oauth.profile.twitter
Class TwitterProfileDefinition
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.twitter.TwitterProfileDefinition
This class is the Twitter profile definition.
- Since:
- 1.1.0
- Author:
- Jerome Leleu
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantCONTRIBUTORS_ENABLED="contributors_enabled"static final StringConstantCREATED_AT="created_at"static final StringConstantDEFAULT_PROFILE="default_profile"static final StringConstantDEFAULT_PROFILE_IMAGE="default_profile_image"static final StringConstantDESCRIPTION="description"static final StringConstantEMAIL="email"static final StringConstantFAVOURITES_COUNT="favourites_count"static final StringConstantFOLLOW_REQUEST_SENT="follow_request_sent"static final StringConstantFOLLOWERS_COUNT="followers_count"static final StringConstantFOLLOWING="following"static final StringConstantFRIENDS_COUNT="friends_count"static final StringConstantGEO_ENABLED="geo_enabled"static final StringConstantIS_TRANSLATOR="is_translator"static final StringConstantLANG="lang"static final StringConstantLISTED_COUNT="listed_count"static final StringConstantNAME="name"static final StringConstantNOTIFICATIONS="notifications"static final StringConstantPROFILE_BACKGROUND_COLOR="profile_background_color"static final StringConstantPROFILE_BACKGROUND_IMAGE_URL="profile_background_image_url"static final StringConstantPROFILE_BACKGROUND_IMAGE_URL_HTTPS="profile_background_image_url_https"static final StringConstantPROFILE_BACKGROUND_TILE="profile_background_tile"static final StringConstantPROFILE_IMAGE_URL="profile_image_url"static final StringConstantPROFILE_IMAGE_URL_HTTPS="profile_image_url_https"static final StringConstantPROFILE_LINK_COLOR="profile_link_color"static final StringConstantPROFILE_SIDEBAR_BORDER_COLOR="profile_sidebar_border_color"static final StringConstantPROFILE_SIDEBAR_FILL_COLOR="profile_sidebar_fill_color"static final StringConstantPROFILE_TEXT_COLOR="profile_text_color"static final StringConstantPROFILE_USE_BACKGROUND_IMAGE="profile_use_background_image"static final StringConstantPROTECTED="protected"static final StringConstantSCREEN_NAME="screen_name"static final StringConstantSHOW_ALL_INLINE_MEDIA="show_all_inline_media"static final StringConstantSTATUSES_COUNT="statuses_count"static final StringConstantTIME_ZONE="time_zone"static final StringConstantURL="url"static final StringConstantUTC_OFFSET="utc_offset"static final StringConstantVERIFIED="verified"Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
DISPLAY_NAME, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URLFields inherited from class org.pac4j.core.profile.definition.ProfileDefinition
logger -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for TwitterProfileDefinition.TwitterProfileDefinition(boolean includeEmail) Constructor for TwitterProfileDefinition. -
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
-
CONTRIBUTORS_ENABLED
ConstantCONTRIBUTORS_ENABLED="contributors_enabled"- See Also:
-
CREATED_AT
ConstantCREATED_AT="created_at"- See Also:
-
DEFAULT_PROFILE
ConstantDEFAULT_PROFILE="default_profile"- See Also:
-
DEFAULT_PROFILE_IMAGE
ConstantDEFAULT_PROFILE_IMAGE="default_profile_image"- See Also:
-
DESCRIPTION
ConstantDESCRIPTION="description"- See Also:
-
EMAIL
ConstantEMAIL="email"- See Also:
-
FAVOURITES_COUNT
ConstantFAVOURITES_COUNT="favourites_count"- See Also:
-
FOLLOW_REQUEST_SENT
ConstantFOLLOW_REQUEST_SENT="follow_request_sent"- See Also:
-
FOLLOWERS_COUNT
ConstantFOLLOWERS_COUNT="followers_count"- See Also:
-
FOLLOWING
ConstantFOLLOWING="following"- See Also:
-
FRIENDS_COUNT
ConstantFRIENDS_COUNT="friends_count"- See Also:
-
GEO_ENABLED
ConstantGEO_ENABLED="geo_enabled"- See Also:
-
IS_TRANSLATOR
ConstantIS_TRANSLATOR="is_translator"- See Also:
-
LANG
ConstantLANG="lang"- See Also:
-
LISTED_COUNT
ConstantLISTED_COUNT="listed_count"- See Also:
-
NAME
ConstantNAME="name"- See Also:
-
NOTIFICATIONS
ConstantNOTIFICATIONS="notifications"- See Also:
-
PROFILE_BACKGROUND_COLOR
ConstantPROFILE_BACKGROUND_COLOR="profile_background_color"- See Also:
-
PROFILE_BACKGROUND_IMAGE_URL
ConstantPROFILE_BACKGROUND_IMAGE_URL="profile_background_image_url"- See Also:
-
PROFILE_BACKGROUND_IMAGE_URL_HTTPS
ConstantPROFILE_BACKGROUND_IMAGE_URL_HTTPS="profile_background_image_url_https"- See Also:
-
PROFILE_BACKGROUND_TILE
ConstantPROFILE_BACKGROUND_TILE="profile_background_tile"- See Also:
-
PROFILE_IMAGE_URL
ConstantPROFILE_IMAGE_URL="profile_image_url"- See Also:
-
PROFILE_IMAGE_URL_HTTPS
ConstantPROFILE_IMAGE_URL_HTTPS="profile_image_url_https"- See Also:
-
PROFILE_LINK_COLOR
ConstantPROFILE_LINK_COLOR="profile_link_color"- See Also:
-
PROFILE_SIDEBAR_BORDER_COLOR
ConstantPROFILE_SIDEBAR_BORDER_COLOR="profile_sidebar_border_color"- See Also:
-
PROFILE_SIDEBAR_FILL_COLOR
ConstantPROFILE_SIDEBAR_FILL_COLOR="profile_sidebar_fill_color"- See Also:
-
PROFILE_TEXT_COLOR
ConstantPROFILE_TEXT_COLOR="profile_text_color"- See Also:
-
PROFILE_USE_BACKGROUND_IMAGE
ConstantPROFILE_USE_BACKGROUND_IMAGE="profile_use_background_image"- See Also:
-
PROTECTED
ConstantPROTECTED="protected"- See Also:
-
SCREEN_NAME
ConstantSCREEN_NAME="screen_name"- See Also:
-
SHOW_ALL_INLINE_MEDIA
ConstantSHOW_ALL_INLINE_MEDIA="show_all_inline_media"- See Also:
-
STATUSES_COUNT
ConstantSTATUSES_COUNT="statuses_count"- See Also:
-
TIME_ZONE
ConstantTIME_ZONE="time_zone"- See Also:
-
URL
ConstantURL="url"- See Also:
-
UTC_OFFSET
ConstantUTC_OFFSET="utc_offset"- See Also:
-
VERIFIED
ConstantVERIFIED="verified"- See Also:
-
-
Constructor Details
-
TwitterProfileDefinition
public TwitterProfileDefinition()Constructor for TwitterProfileDefinition.
-
TwitterProfileDefinition
public TwitterProfileDefinition(boolean includeEmail) Constructor for TwitterProfileDefinition.
- Parameters:
includeEmail- a boolean
-
-
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
-