Package org.pac4j.oauth.profile.wechat
Class WechatProfileDefinition
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.wechat.WechatProfileDefinition
This class defines the attributes of the Wechat profile.
- Since:
- 3.1.0
- Author:
- zhangzhenli
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
ConstantCITY="city"
static final String
country, For example, China is CNstatic final String
User avatar, the last value represents the size of the square avatar (0, 46, 64, 96, 132 values are optional, 0 is 640 * 640 square avatar), the item is empty when the user has no avatarstatic final String
ConstantNICKNAME="nickname"
static final String
ConstantOPENID="openid"
static final String
User privilege information, json array, such as WeChat Waka users (chinaunicom)static final String
ConstantPROVINCE="province"
static final String
Gender, 1 male and 2 femalestatic final String
User union identity.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
-
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, 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, getLogger, getParameter, getPrimaryAttributes, getProfileFactory, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
Field Details
-
OPENID
ConstantOPENID="openid"
- See Also:
-
NICKNAME
ConstantNICKNAME="nickname"
- See Also:
-
SEX
Gender, 1 male and 2 female- See Also:
-
PROVINCE
ConstantPROVINCE="province"
- See Also:
-
CITY
ConstantCITY="city"
- See Also:
-
COUNTRY
country, For example, China is CN- See Also:
-
HEADIMGURL
User avatar, the last value represents the size of the square avatar (0, 46, 64, 96, 132 values are optional, 0 is 640 * 640 square avatar), the item is empty when the user has no avatar- See Also:
-
PRIVILEGE
User privilege information, json array, such as WeChat Waka users (chinaunicom)- See Also:
-
UNIONID
User union identity. For an application under the WeChat open platform account, the unionid of the same user is unique.- See Also:
-
-
Constructor Details
-
WechatProfileDefinition
public WechatProfileDefinition()Constructor for WechatProfileDefinition.
-
-
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:
getProfileUrl
in 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:
extractUserProfile
in classOAuthProfileDefinition
- Parameters:
body
- the response body- Returns:
- the returned profile
-