Package org.pac4j.oauth.profile.ok
Class OkProfileDefinition
- java.lang.Object
-
- org.pac4j.core.profile.definition.ProfileDefinition<P>
-
- org.pac4j.core.profile.definition.CommonProfileDefinition<P>
-
- org.pac4j.oauth.profile.definition.OAuthProfileDefinition<P,com.github.scribejava.core.model.OAuth2AccessToken,C>
-
- org.pac4j.oauth.profile.definition.OAuth20ProfileDefinition<OkProfile,OkConfiguration>
-
- org.pac4j.oauth.profile.ok.OkProfileDefinition
-
public class OkProfileDefinition extends OAuth20ProfileDefinition<OkProfile,OkConfiguration>
Represents the profile definitions on Ok.ru (Odnoklassniki.ru)- Since:
- 1.8
- Author:
- imayka (imayka[at]ymail[dot]com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringAGEstatic StringBIRTHDAYstatic StringCURRENT_STATUSstatic StringCURRENT_STATUS_DATEstatic StringCURRENT_STATUS_IDstatic StringHAS_EMAILstatic StringLAST_NAMEstatic StringLOCATION_CITYstatic StringLOCATION_COUNTRYstatic StringLOCATION_COUNTRY_CODEstatic StringLOCATION_COUNTRY_NAMEstatic StringNAMEstatic StringONLINEstatic StringPIC_1static StringPIC_2static StringUID-
Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URL
-
Fields inherited from class org.pac4j.core.profile.definition.ProfileDefinition
logger, newProfile
-
-
Constructor Summary
Constructors Constructor Description OkProfileDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OkProfileextractUserProfile(String body)Extract the user profile from the response (JSON, XML...) of the profile url.protected StringgetMD5SignAsHexString(String strForEncoding)StringgetProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OkConfiguration 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, getPrimaryAttributes, getProfileId, getSecondaryAttributes, newProfile, primary, secondary, setProfileFactory, setProfileId
-
-
-
-
Field Detail
-
UID
public static final String UID
- See Also:
- Constant Field Values
-
BIRTHDAY
public static final String BIRTHDAY
- See Also:
- Constant Field Values
-
AGE
public static final String AGE
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
LOCATION_CITY
public static final String LOCATION_CITY
- See Also:
- Constant Field Values
-
LOCATION_COUNTRY
public static final String LOCATION_COUNTRY
- See Also:
- Constant Field Values
-
LOCATION_COUNTRY_CODE
public static final String LOCATION_COUNTRY_CODE
- See Also:
- Constant Field Values
-
LOCATION_COUNTRY_NAME
public static final String LOCATION_COUNTRY_NAME
- See Also:
- Constant Field Values
-
ONLINE
public static final String ONLINE
- See Also:
- Constant Field Values
-
LAST_NAME
public static final String LAST_NAME
- See Also:
- Constant Field Values
-
HAS_EMAIL
public static final String HAS_EMAIL
- See Also:
- Constant Field Values
-
CURRENT_STATUS
public static final String CURRENT_STATUS
- See Also:
- Constant Field Values
-
CURRENT_STATUS_ID
public static final String CURRENT_STATUS_ID
- See Also:
- Constant Field Values
-
CURRENT_STATUS_DATE
public static final String CURRENT_STATUS_DATE
- See Also:
- Constant Field Values
-
PIC_1
public static final String PIC_1
- See Also:
- Constant Field Values
-
PIC_2
public static final String PIC_2
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProfileUrl
public String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OkConfiguration configuration)
Description copied from class:OAuthProfileDefinitionRetrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrlin classOAuthProfileDefinition<OkProfile,com.github.scribejava.core.model.OAuth2AccessToken,OkConfiguration>- 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
-
getMD5SignAsHexString
protected String getMD5SignAsHexString(String strForEncoding) throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
-
extractUserProfile
public OkProfile extractUserProfile(String body)
Description copied from class:OAuthProfileDefinitionExtract the user profile from the response (JSON, XML...) of the profile url.- Specified by:
extractUserProfilein classOAuthProfileDefinition<OkProfile,com.github.scribejava.core.model.OAuth2AccessToken,OkConfiguration>- Parameters:
body- the response body- Returns:
- the returned profile
-
-