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.String
CONTRIBUTORS_ENABLED
static java.lang.String
CREATED_AT
static java.lang.String
DEFAULT_PROFILE
static java.lang.String
DEFAULT_PROFILE_IMAGE
static java.lang.String
DESCRIPTION
static java.lang.String
EMAIL
static java.lang.String
FAVOURITES_COUNT
static java.lang.String
FOLLOW_REQUEST_SENT
static java.lang.String
FOLLOWERS_COUNT
static java.lang.String
FOLLOWING
static java.lang.String
FRIENDS_COUNT
static java.lang.String
GEO_ENABLED
static java.lang.String
IS_TRANSLATOR
static java.lang.String
LANG
static java.lang.String
LISTED_COUNT
static java.lang.String
NAME
static java.lang.String
NOTIFICATIONS
static java.lang.String
PROFILE_BACKGROUND_COLOR
static java.lang.String
PROFILE_BACKGROUND_IMAGE_URL
static java.lang.String
PROFILE_BACKGROUND_IMAGE_URL_HTTPS
static java.lang.String
PROFILE_BACKGROUND_TILE
static java.lang.String
PROFILE_IMAGE_URL
static java.lang.String
PROFILE_IMAGE_URL_HTTPS
static java.lang.String
PROFILE_LINK_COLOR
static java.lang.String
PROFILE_SIDEBAR_BORDER_COLOR
static java.lang.String
PROFILE_SIDEBAR_FILL_COLOR
static java.lang.String
PROFILE_TEXT_COLOR
static java.lang.String
PROFILE_USE_BACKGROUND_IMAGE
static java.lang.String
PROTECTED
static java.lang.String
SCREEN_NAME
static java.lang.String
SHOW_ALL_INLINE_MEDIA
static java.lang.String
STATUSES_COUNT
static java.lang.String
TIME_ZONE
static java.lang.String
URL
static java.lang.String
UTC_OFFSET
static java.lang.String
VERIFIED
-
Constructor Summary
Constructors Constructor Description TwitterProfileDefinition()
TwitterProfileDefinition(boolean includeEmail)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TwitterProfile
extractUserProfile(java.lang.String body)
Extract the user profile from the response (JSON, XML...) of the profile url.java.lang.String
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, 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:OAuthProfileDefinition
Retrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrl
in 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:OAuthProfileDefinition
Extract the user profile from the response (JSON, XML...) of the profile url.- Specified by:
extractUserProfile
in classOAuthProfileDefinition
- Parameters:
body
- the response body- Returns:
- the returned profile
-
-