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
-
public class TwitterProfileDefinition extends OAuthProfileDefinition
This class is the Twitter profile definition.- Since:
- 1.1.0
- Author:
- Jerome Leleu
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTRIBUTORS_ENABLEDstatic java.lang.StringCREATED_ATstatic java.lang.StringDEFAULT_PROFILEstatic java.lang.StringDEFAULT_PROFILE_IMAGEstatic java.lang.StringDESCRIPTIONstatic java.lang.StringEMAILstatic java.lang.StringFAVOURITES_COUNTstatic java.lang.StringFOLLOW_REQUEST_SENTstatic java.lang.StringFOLLOWERS_COUNTstatic java.lang.StringFOLLOWINGstatic java.lang.StringFRIENDS_COUNTstatic java.lang.StringGEO_ENABLEDstatic java.lang.StringIS_TRANSLATORstatic java.lang.StringLANGstatic java.lang.StringLISTED_COUNTstatic java.lang.StringNAMEstatic java.lang.StringNOTIFICATIONSstatic java.lang.StringPROFILE_BACKGROUND_COLORstatic java.lang.StringPROFILE_BACKGROUND_IMAGE_URLstatic java.lang.StringPROFILE_BACKGROUND_IMAGE_URL_HTTPSstatic java.lang.StringPROFILE_BACKGROUND_TILEstatic java.lang.StringPROFILE_IMAGE_URLstatic java.lang.StringPROFILE_IMAGE_URL_HTTPSstatic java.lang.StringPROFILE_LINK_COLORstatic java.lang.StringPROFILE_SIDEBAR_BORDER_COLORstatic java.lang.StringPROFILE_SIDEBAR_FILL_COLORstatic java.lang.StringPROFILE_TEXT_COLORstatic java.lang.StringPROFILE_USE_BACKGROUND_IMAGEstatic java.lang.StringPROTECTEDstatic java.lang.StringSCREEN_NAMEstatic java.lang.StringSHOW_ALL_INLINE_MEDIAstatic java.lang.StringSTATUSES_COUNTstatic java.lang.StringTIME_ZONEstatic java.lang.StringURLstatic java.lang.StringUTC_OFFSETstatic java.lang.StringVERIFIED
-
Constructor Summary
Constructors Constructor Description TwitterProfileDefinition()TwitterProfileDefinition(boolean includeEmail)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TwitterProfileextractUserProfile(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
-
CONTRIBUTORS_ENABLED
public static final java.lang.String CONTRIBUTORS_ENABLED
- See Also:
- Constant Field Values
-
CREATED_AT
public static final java.lang.String CREATED_AT
- See Also:
- Constant Field Values
-
DEFAULT_PROFILE
public static final java.lang.String DEFAULT_PROFILE
- See Also:
- Constant Field Values
-
DEFAULT_PROFILE_IMAGE
public static final java.lang.String DEFAULT_PROFILE_IMAGE
- See Also:
- Constant Field Values
-
DESCRIPTION
public static final java.lang.String DESCRIPTION
- See Also:
- Constant Field Values
-
EMAIL
public static final java.lang.String EMAIL
- See Also:
- Constant Field Values
-
FAVOURITES_COUNT
public static final java.lang.String FAVOURITES_COUNT
- See Also:
- Constant Field Values
-
FOLLOW_REQUEST_SENT
public static final java.lang.String FOLLOW_REQUEST_SENT
- See Also:
- Constant Field Values
-
FOLLOWERS_COUNT
public static final java.lang.String FOLLOWERS_COUNT
- See Also:
- Constant Field Values
-
FOLLOWING
public static final java.lang.String FOLLOWING
- See Also:
- Constant Field Values
-
FRIENDS_COUNT
public static final java.lang.String FRIENDS_COUNT
- See Also:
- Constant Field Values
-
GEO_ENABLED
public static final java.lang.String GEO_ENABLED
- See Also:
- Constant Field Values
-
IS_TRANSLATOR
public static final java.lang.String IS_TRANSLATOR
- See Also:
- Constant Field Values
-
LANG
public static final java.lang.String LANG
- See Also:
- Constant Field Values
-
LISTED_COUNT
public static final java.lang.String LISTED_COUNT
- See Also:
- Constant Field Values
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
NOTIFICATIONS
public static final java.lang.String NOTIFICATIONS
- See Also:
- Constant Field Values
-
PROFILE_BACKGROUND_COLOR
public static final java.lang.String PROFILE_BACKGROUND_COLOR
- See Also:
- Constant Field Values
-
PROFILE_BACKGROUND_IMAGE_URL
public static final java.lang.String PROFILE_BACKGROUND_IMAGE_URL
- See Also:
- Constant Field Values
-
PROFILE_BACKGROUND_IMAGE_URL_HTTPS
public static final java.lang.String PROFILE_BACKGROUND_IMAGE_URL_HTTPS
- See Also:
- Constant Field Values
-
PROFILE_BACKGROUND_TILE
public static final java.lang.String PROFILE_BACKGROUND_TILE
- See Also:
- Constant Field Values
-
PROFILE_IMAGE_URL
public static final java.lang.String PROFILE_IMAGE_URL
- See Also:
- Constant Field Values
-
PROFILE_IMAGE_URL_HTTPS
public static final java.lang.String PROFILE_IMAGE_URL_HTTPS
- See Also:
- Constant Field Values
-
PROFILE_LINK_COLOR
public static final java.lang.String PROFILE_LINK_COLOR
- See Also:
- Constant Field Values
-
PROFILE_SIDEBAR_BORDER_COLOR
public static final java.lang.String PROFILE_SIDEBAR_BORDER_COLOR
- See Also:
- Constant Field Values
-
PROFILE_SIDEBAR_FILL_COLOR
public static final java.lang.String PROFILE_SIDEBAR_FILL_COLOR
- See Also:
- Constant Field Values
-
PROFILE_TEXT_COLOR
public static final java.lang.String PROFILE_TEXT_COLOR
- See Also:
- Constant Field Values
-
PROFILE_USE_BACKGROUND_IMAGE
public static final java.lang.String PROFILE_USE_BACKGROUND_IMAGE
- See Also:
- Constant Field Values
-
PROTECTED
public static final java.lang.String PROTECTED
- See Also:
- Constant Field Values
-
SCREEN_NAME
public static final java.lang.String SCREEN_NAME
- See Also:
- Constant Field Values
-
SHOW_ALL_INLINE_MEDIA
public static final java.lang.String SHOW_ALL_INLINE_MEDIA
- See Also:
- Constant Field Values
-
STATUSES_COUNT
public static final java.lang.String STATUSES_COUNT
- See Also:
- Constant Field Values
-
TIME_ZONE
public static final java.lang.String TIME_ZONE
- See Also:
- Constant Field Values
-
URL
public static final java.lang.String URL
- See Also:
- Constant Field Values
-
UTC_OFFSET
public static final java.lang.String UTC_OFFSET
- See Also:
- Constant Field Values
-
VERIFIED
public static final java.lang.String VERIFIED
- 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 TwitterProfile 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
-
-