Package org.pac4j.oauth.profile.qq
Class QQProfileDefinition
- 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<QQProfile,OAuth20Configuration>
-
- org.pac4j.oauth.profile.qq.QQProfileDefinition
-
public class QQProfileDefinition extends OAuth20ProfileDefinition<QQProfile,OAuth20Configuration>
This class defines the attributes of the Tencent QQ Connect profile.More info at: get_user_info
- Since:
- 3.1.0
- Author:
- zhangzhenli
-
-
Field Summary
Fields Modifier and Type Field Description static String
CITY
static String
FIGUREURL
static String
FIGUREURL_1
static String
FIGUREURL_2
static String
FIGUREURL_QQ_1
static String
FIGUREURL_QQ_2
static String
MSG
static String
NICKNAME
static Pattern
OPENID_REGEX
static String
PROVINCE
static String
RET
static String
YEAR
-
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 QQProfileDefinition()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
extractOpenid(String body)
protected static String
extractParameter(String response, Pattern regexPattern, boolean required)
QQProfile
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.String
getOpenidUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)
String
getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration 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
-
OPENID_REGEX
public static final Pattern OPENID_REGEX
-
RET
public static final String RET
- See Also:
- Constant Field Values
-
MSG
public static final String MSG
- See Also:
- Constant Field Values
-
NICKNAME
public static final String NICKNAME
- See Also:
- Constant Field Values
-
PROVINCE
public static final String PROVINCE
- See Also:
- Constant Field Values
-
CITY
public static final String CITY
- See Also:
- Constant Field Values
-
YEAR
public static final String YEAR
- See Also:
- Constant Field Values
-
FIGUREURL
public static final String FIGUREURL
- See Also:
- Constant Field Values
-
FIGUREURL_1
public static final String FIGUREURL_1
- See Also:
- Constant Field Values
-
FIGUREURL_2
public static final String FIGUREURL_2
- See Also:
- Constant Field Values
-
FIGUREURL_QQ_1
public static final String FIGUREURL_QQ_1
- See Also:
- Constant Field Values
-
FIGUREURL_QQ_2
public static final String FIGUREURL_QQ_2
- See Also:
- Constant Field Values
-
-
Method Detail
-
getOpenidUrl
public String getOpenidUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)
-
getProfileUrl
public String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)
Description copied from class:OAuthProfileDefinition
Retrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrl
in classOAuthProfileDefinition<QQProfile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>
- 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
public QQProfile 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<QQProfile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>
- Parameters:
body
- the response body- Returns:
- the returned profile
-
-