Package org.pac4j.oauth.profile.ok
Class OkProfileDefinition
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.ok.OkProfileDefinition
Represents the profile definitions on Ok.ru (Odnoklassniki.ru)
- Since:
- 1.8
- Author:
- imayka (imayka[at]ymail[dot]com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantAGE="age"static final StringConstantBIRTHDAY="birthday"static final StringConstantCURRENT_STATUS="current_status"static final StringConstantCURRENT_STATUS_DATE="current_status_date"static final StringConstantCURRENT_STATUS_ID="current_status_id"static final StringConstantHAS_EMAIL="has_email"static final StringConstantLAST_NAME="last_name"static final StringConstantLOCATION_CITY="location.city"static final StringConstantLOCATION_COUNTRY="location.country"static final StringConstantLOCATION_COUNTRY_CODE="location.countryCode"static final StringConstantLOCATION_COUNTRY_NAME="location.countryName"static final StringConstantNAME="name"static final StringConstantONLINE="online"static final StringConstantPIC_1="pic_1"static final StringConstantPIC_2="pic_2"static final StringConstantUID="uid"Fields 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 TypeMethodDescriptionextractUserProfile(String body) Extract the user profile from the response (JSON, XML...) of the profile url.protected StringgetMD5SignAsHexString(String strForEncoding) getMD5SignAsHexString.getProfileUrl(com.github.scribejava.core.model.Token token, 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
-
UID
ConstantUID="uid"- See Also:
-
BIRTHDAY
ConstantBIRTHDAY="birthday"- See Also:
-
AGE
ConstantAGE="age"- See Also:
-
NAME
ConstantNAME="name"- See Also:
-
LOCATION_CITY
ConstantLOCATION_CITY="location.city"- See Also:
-
LOCATION_COUNTRY
ConstantLOCATION_COUNTRY="location.country"- See Also:
-
LOCATION_COUNTRY_CODE
ConstantLOCATION_COUNTRY_CODE="location.countryCode"- See Also:
-
LOCATION_COUNTRY_NAME
ConstantLOCATION_COUNTRY_NAME="location.countryName"- See Also:
-
ONLINE
ConstantONLINE="online"- See Also:
-
LAST_NAME
ConstantLAST_NAME="last_name"- See Also:
-
HAS_EMAIL
ConstantHAS_EMAIL="has_email"- See Also:
-
CURRENT_STATUS
ConstantCURRENT_STATUS="current_status"- See Also:
-
CURRENT_STATUS_ID
ConstantCURRENT_STATUS_ID="current_status_id"- See Also:
-
CURRENT_STATUS_DATE
ConstantCURRENT_STATUS_DATE="current_status_date"- See Also:
-
PIC_1
ConstantPIC_1="pic_1"- See Also:
-
PIC_2
ConstantPIC_2="pic_2"- See Also:
-
-
Constructor Details
-
OkProfileDefinition
public OkProfileDefinition()Constructor for OkProfileDefinition.
-
-
Method Details
-
getProfileUrl
public String getProfileUrl(com.github.scribejava.core.model.Token token, OAuthConfiguration configuration) Retrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrlin classOAuthProfileDefinition- Parameters:
token- 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
-
getMD5SignAsHexString
getMD5SignAsHexString.
- Parameters:
strForEncoding- aStringobject- Returns:
- a
Stringobject - Throws:
NoSuchAlgorithmException- if any.
-
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
-