Package org.pac4j.oauth.profile.vk
Class VkProfileDefinition
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.vk.VkProfileDefinition
This class is the Vk profile definition.
- Since:
- 1.5
- Author:
- indvdum (gotoindvdum[at]gmail[dot]com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringConstantBASE_URL="https://api.vk.com/method/users.get"static final StringConstantBIRTH_DATE="bdate"static final StringConstantCAN_POST="can_post"static final StringConstantCAN_SEE_ALL_POST="can_see_all_posts"static final StringConstantCAN_SEE_AUDIO="can_see_audio"static final StringConstantCAN_WRITE_PRIVATE_MESSAGE="can_write_private_message"static final StringConstantCOMMON_COUNT="common_count"static final StringConstantDOMAIN="domain"static final StringConstantHAS_MOBILE="has_mobile"static final StringConstantHOME_PHONE="home_phone"static final StringConstantLAST_NAME="last_name"static final StringConstantMOBILE_PHONE="mobile_phone"static final StringConstantONLINE="online"static final StringConstantONLINE_MOBILE="online_mobile"static final StringConstantPHOTO_100="photo_100"static final StringConstantPHOTO_200="photo_200"static final StringConstantPHOTO_200_ORIG="photo_200_orig"static final StringConstantPHOTO_400_ORIG="photo_400_orig"static final StringConstantPHOTO_50="photo_50"static final StringConstantPHOTO_MAX="photo_max"static final StringConstantPHOTO_MAX_ORIG="photo_max_orig"static final StringConstantRELATION="relation"static final StringConstantSEX="sex"static final StringConstantSITE="site"static final StringConstantSKYPE="skype"static final StringConstantSTATUS="status"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.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, getLogger, getParameter, getPrimaryAttributes, getProfileFactory, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
Field Details
-
LAST_NAME
ConstantLAST_NAME="last_name"- See Also:
-
SEX
ConstantSEX="sex"- See Also:
-
BIRTH_DATE
ConstantBIRTH_DATE="bdate"- See Also:
-
PHOTO_50
ConstantPHOTO_50="photo_50"- See Also:
-
PHOTO_100
ConstantPHOTO_100="photo_100"- See Also:
-
PHOTO_200_ORIG
ConstantPHOTO_200_ORIG="photo_200_orig"- See Also:
-
PHOTO_200
ConstantPHOTO_200="photo_200"- See Also:
-
PHOTO_400_ORIG
ConstantPHOTO_400_ORIG="photo_400_orig"- See Also:
-
PHOTO_MAX
ConstantPHOTO_MAX="photo_max"- See Also:
-
PHOTO_MAX_ORIG
ConstantPHOTO_MAX_ORIG="photo_max_orig"- See Also:
-
ONLINE
ConstantONLINE="online"- See Also:
-
ONLINE_MOBILE
ConstantONLINE_MOBILE="online_mobile"- See Also:
-
DOMAIN
ConstantDOMAIN="domain"- See Also:
-
HAS_MOBILE
ConstantHAS_MOBILE="has_mobile"- See Also:
-
MOBILE_PHONE
ConstantMOBILE_PHONE="mobile_phone"- See Also:
-
HOME_PHONE
ConstantHOME_PHONE="home_phone"- See Also:
-
SKYPE
ConstantSKYPE="skype"- See Also:
-
SITE
ConstantSITE="site"- See Also:
-
CAN_POST
ConstantCAN_POST="can_post"- See Also:
-
CAN_SEE_ALL_POST
ConstantCAN_SEE_ALL_POST="can_see_all_posts"- See Also:
-
CAN_SEE_AUDIO
ConstantCAN_SEE_AUDIO="can_see_audio"- See Also:
-
CAN_WRITE_PRIVATE_MESSAGE
ConstantCAN_WRITE_PRIVATE_MESSAGE="can_write_private_message"- See Also:
-
STATUS
ConstantSTATUS="status"- See Also:
-
COMMON_COUNT
ConstantCOMMON_COUNT="common_count"- See Also:
-
RELATION
ConstantRELATION="relation"- See Also:
-
BASE_URL
ConstantBASE_URL="https://api.vk.com/method/users.get"- See Also:
-
-
Constructor Details
-
VkProfileDefinition
public VkProfileDefinition()Constructor for VkProfileDefinition.
-
-
Method Details
-
getProfileUrl
public String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration) Retrieve 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
-
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
-