Package org.pac4j.oauth.profile.qq
Class QQProfileDefinition
- 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.qq.QQProfileDefinition
-
public class QQProfileDefinition extends OAuthProfileDefinition
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 java.lang.String
CITY
static java.lang.String
FIGUREURL
static java.lang.String
FIGUREURL_1
static java.lang.String
FIGUREURL_2
static java.lang.String
FIGUREURL_QQ_1
static java.lang.String
FIGUREURL_QQ_2
static java.lang.String
MSG
static java.lang.String
NICKNAME
static java.util.regex.Pattern
OPENID_REGEX
static java.lang.String
PROVINCE
static java.lang.String
RET
static java.lang.String
YEAR
-
Constructor Summary
Constructors Constructor Description QQProfileDefinition()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
extractOpenid(java.lang.String body)
protected static java.lang.String
extractParameter(java.lang.String response, java.util.regex.Pattern regexPattern, boolean required)
QQProfile
extractUserProfile(java.lang.String body)
Extract the user profile from the response (JSON, XML...) of the profile url.java.lang.String
getOpenidUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)
java.lang.String
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, getParameter, getPrimaryAttributes, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
-
-
-
Field Detail
-
OPENID_REGEX
public static final java.util.regex.Pattern OPENID_REGEX
-
RET
public static final java.lang.String RET
- See Also:
- Constant Field Values
-
MSG
public static final java.lang.String MSG
- See Also:
- Constant Field Values
-
NICKNAME
public static final java.lang.String NICKNAME
- See Also:
- Constant Field Values
-
PROVINCE
public static final java.lang.String PROVINCE
- See Also:
- Constant Field Values
-
CITY
public static final java.lang.String CITY
- See Also:
- Constant Field Values
-
YEAR
public static final java.lang.String YEAR
- See Also:
- Constant Field Values
-
FIGUREURL
public static final java.lang.String FIGUREURL
- See Also:
- Constant Field Values
-
FIGUREURL_1
public static final java.lang.String FIGUREURL_1
- See Also:
- Constant Field Values
-
FIGUREURL_2
public static final java.lang.String FIGUREURL_2
- See Also:
- Constant Field Values
-
FIGUREURL_QQ_1
public static final java.lang.String FIGUREURL_QQ_1
- See Also:
- Constant Field Values
-
FIGUREURL_QQ_2
public static final java.lang.String FIGUREURL_QQ_2
- See Also:
- Constant Field Values
-
-
Method Detail
-
getOpenidUrl
public java.lang.String getOpenidUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)
-
getProfileUrl
public java.lang.String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration)
Description copied from class:OAuthProfileDefinition
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
public QQProfile extractUserProfile(java.lang.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
- Parameters:
body
- the response body- Returns:
- the returned profile
-
extractOpenid
public java.lang.String extractOpenid(java.lang.String body)
-
extractParameter
protected static java.lang.String extractParameter(java.lang.String response, java.util.regex.Pattern regexPattern, boolean required) throws com.github.scribejava.core.exceptions.OAuthException
- Throws:
com.github.scribejava.core.exceptions.OAuthException
-
-