Package org.pac4j.oauth.profile.facebook
Class FacebookProfileDefinition
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.facebook.FacebookProfileDefinition
This class is the Facebook profile definition.
- Since:
- 1.1.0
- Author:
- Jerome Leleu
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_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 TypeMethodDescriptioncomputeAppSecretProof(String url, com.github.scribejava.core.model.OAuth2AccessToken token, FacebookConfiguration configuration) The code in this method is based on this blog post: https://www.sammyk.me/the-single-most-important-way-to-make-your-facebook-app-more-secure and this answer: https://stackoverflow.com/questions/7124735/hmac-sha256-algorithm-for-signature-calculationprotected voidextractData(FacebookProfile profile, com.fasterxml.jackson.databind.JsonNode json, String name) extractUserProfile(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, getParameter, getPrimaryAttributes, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
Field Details
-
NAME
- See Also:
-
MIDDLE_NAME
- See Also:
-
LAST_NAME
- See Also:
-
LANGUAGES
- See Also:
-
LINK
- See Also:
-
THIRD_PARTY_ID
- See Also:
-
TIMEZONE
- See Also:
-
UPDATED_TIME
- See Also:
-
VERIFIED
- See Also:
-
ABOUT
- See Also:
-
BIRTHDAY
- See Also:
-
EDUCATION
- See Also:
-
HOMETOWN
- See Also:
-
INTERESTED_IN
- See Also:
-
POLITICAL
- See Also:
-
FAVORITE_ATHLETES
- See Also:
-
FAVORITE_TEAMS
- See Also:
-
QUOTES
- See Also:
-
RELATIONSHIP_STATUS
- See Also:
-
RELIGION
- See Also:
-
SIGNIFICANT_OTHER
- See Also:
-
WEBSITE
- See Also:
-
WORK
- See Also:
-
FRIENDS
- See Also:
-
MOVIES
- See Also:
-
MUSIC
- See Also:
-
BOOKS
- See Also:
-
LIKES
- See Also:
-
ALBUMS
- See Also:
-
EVENTS
- See Also:
-
GROUPS
- See Also:
-
MUSIC_LISTENS
- See Also:
-
PICTURE
- See Also:
-
DEFAULT_LIMIT
public static final int DEFAULT_LIMIT- See Also:
-
BASE_URL
- See Also:
-
APPSECRET_PARAMETER
- See Also:
-
-
Constructor Details
-
FacebookProfileDefinition
public FacebookProfileDefinition()
-
-
Method Details
-
getProfileUrl
public 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
-
computeAppSecretProof
public String computeAppSecretProof(String url, com.github.scribejava.core.model.OAuth2AccessToken token, FacebookConfiguration configuration) The code in this method is based on this blog post: https://www.sammyk.me/the-single-most-important-way-to-make-your-facebook-app-more-secure and this answer: https://stackoverflow.com/questions/7124735/hmac-sha256-algorithm-for-signature-calculation- Parameters:
url- the URL to which we're adding the prooftoken- the application token we pass back and forthconfiguration- the current configuration- Returns:
- URL with the appsecret_proof parameter added
-
extractUserProfile
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
-
extractData
protected void extractData(FacebookProfile profile, com.fasterxml.jackson.databind.JsonNode json, String name)
-