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 String
AGE
static String
BIRTHDAY
static String
CURRENT_STATUS
static String
CURRENT_STATUS_DATE
static String
CURRENT_STATUS_ID
static String
HAS_EMAIL
static String
LAST_NAME
static String
LOCATION_CITY
static String
LOCATION_COUNTRY
static String
LOCATION_COUNTRY_CODE
static String
LOCATION_COUNTRY_NAME
static String
NAME
static String
ONLINE
static String
PIC_1
static String
PIC_2
static String
UID
-
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 OkProfile
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.protected String
getMD5SignAsHexString(String strForEncoding)
String
getProfileUrl(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:OAuthProfileDefinition
Retrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrl
in 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:OAuthProfileDefinition
Extract the user profile from the response (JSON, XML...) of the profile url.- Specified by:
extractUserProfile
in classOAuthProfileDefinition<OkProfile,com.github.scribejava.core.model.OAuth2AccessToken,OkConfiguration>
- Parameters:
body
- the response body- Returns:
- the returned profile
-
-