public class WechatProfileDefinition extends OAuth20ProfileDefinition<WechatProfile,OAuth20Configuration>
More info at: https://api.weixin.qq.com/sns/userinfo
Modifier and Type | Field and Description |
---|---|
static String |
CITY |
static String |
COUNTRY
country, For example, China is CN
|
static String |
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
|
static String |
NICKNAME |
static String |
OPENID |
static String |
PRIVILEGE
User privilege information, json array, such as WeChat Waka users (chinaunicom)
|
static String |
PROVINCE |
static String |
SEX
Gender, 1 male and 2 female
|
static String |
UNIONID
User union identity.
|
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URL
logger, newProfile
Constructor and Description |
---|
WechatProfileDefinition() |
Modifier and Type | Method and Description |
---|---|
WechatProfile |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
String |
getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken,
OAuth20Configuration configuration)
Retrieve the url of the profile of the authenticated user for the provider.
|
getProfileVerb
convertAndAdd, convertAndAdd, getConverters, getPrimaryAttributes, getProfileId, getSecondaryAttributes, newProfile, primary, secondary, setProfileFactory, setProfileId
public static final String OPENID
public static final String NICKNAME
public static final String SEX
public static final String PROVINCE
public static final String CITY
public static final String COUNTRY
public static final String HEADIMGURL
public static final String PRIVILEGE
public static final String UNIONID
public String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)
OAuthProfileDefinition
getProfileUrl
in class OAuthProfileDefinition<WechatProfile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>
accessToken
- only used when constructing dynamic urls from data in the tokenconfiguration
- the current configurationpublic WechatProfile extractUserProfile(String body)
OAuthProfileDefinition
extractUserProfile
in class OAuthProfileDefinition<WechatProfile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>
body
- the response bodyCopyright © 2018. All rights reserved.