Package org.pac4j.oauth.profile.weibo
Class WeiboProfileDefinition
- 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<WeiboProfile,OAuth20Configuration>
-
- org.pac4j.oauth.profile.weibo.WeiboProfileDefinition
-
public class WeiboProfileDefinition extends OAuth20ProfileDefinition<WeiboProfile,OAuth20Configuration>
This class is the Sina Weibo profile definition (using OAuth 2.0 protocol).More info at: users/show
- Since:
- 3.1.0
- Author:
- zhangzhenli
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALLOW_ALL_ACT_MSG
boolean Whether to allow everyone to send me a private message, true: yes, false: nostatic String
ALLOW_ALL_COMMENT
boolean Whether to allow everyone to comment on my Weibo, true: yes, false: nostatic String
AVATAR_HD
string User avatar address (HD), HD avatar originalstatic String
AVATAR_LARGE
string User avatar address (larger image), 180 × 180 pixelsstatic String
BI_FOLLOWERS_COUNT
int User's mutual powder countstatic String
CITY
int User's city IDstatic String
COVER_IMAGE_PHONE
url User cover image urlstatic String
CREATED_AT
string User creation (registration) timestatic String
DESCRIPTION
string User personal descriptionstatic String
DOMAIN
string User's personalized domain namestatic String
FAVOURITES_COUNT
int Number of favoritesstatic String
FOLLOW_ME
boolean Whether the user is concerned about the currently logged in user, true: yes, false: nostatic String
FOLLOWERS_COUNT
int Number of fansstatic String
FOLLOWING
boolean Not supported yetstatic String
FRIENDS_COUNT
int Number of followersstatic String
GENDER
string Gender, m: male, f: female, n: unknownstatic String
GEO_ENABLED
boolean Whether to allow identification of the user's geographic location, true: yes, false: nostatic String
ID
int64 User UIDstatic String
IDSTR
string String-type user UIDstatic String
LANG
string User's current language version, zh-cn: Simplified Chinese, zh-tw: Traditional Chinese, en: Englishstatic String
LOCATION
string User locationstatic String
NAME
string Friendly display namestatic String
ONLINE_STATUS
int User's online status, 0: not online, 1: onlinestatic String
PROFILE_IMAGE_URL
url User avatar address (middle), 50×50 pixelsstatic String
PROFILE_URL
url User's Weibo unified URL addressstatic String
PROVINCE
int User's provincial IDstatic String
REMARK
string User note information, this field is only returned when querying user relationshipsstatic String
SCREEN_NAME
string User's Nicknamestatic String
STATUS
object User's recent Weibo information fieldstatic String
STATUSES_COUNT
int Weibo numberstatic String
URL
url User blog addressstatic String
VERIFIED
boolean Whether it is a Weibo authenticated user, that is, a V-user, true: yes, false: nostatic String
VERIFIED_REASON
string Reason for certificationstatic String
VERIFIED_TYPE
int Not supported yetstatic String
WEIHAO
string User's weihao number-
Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, LOCALE, PICTURE_URL
-
Fields inherited from class org.pac4j.core.profile.definition.ProfileDefinition
logger, newProfile
-
-
Constructor Summary
Constructors Constructor Description WeiboProfileDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WeiboProfile
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.-
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
-
ID
public static final String ID
int64 User UID- See Also:
- Constant Field Values
-
IDSTR
public static final String IDSTR
string String-type user UID- See Also:
- Constant Field Values
-
SCREEN_NAME
public static final String SCREEN_NAME
string User's Nickname- See Also:
- Constant Field Values
-
NAME
public static final String NAME
string Friendly display name- See Also:
- Constant Field Values
-
PROVINCE
public static final String PROVINCE
int User's provincial ID- See Also:
- Constant Field Values
-
CITY
public static final String CITY
int User's city ID- See Also:
- Constant Field Values
-
LOCATION
public static final String LOCATION
string User location- See Also:
- Constant Field Values
-
DESCRIPTION
public static final String DESCRIPTION
string User personal description- See Also:
- Constant Field Values
-
URL
public static final String URL
url User blog address- See Also:
- Constant Field Values
-
PROFILE_IMAGE_URL
public static final String PROFILE_IMAGE_URL
url User avatar address (middle), 50×50 pixels- See Also:
- Constant Field Values
-
COVER_IMAGE_PHONE
public static final String COVER_IMAGE_PHONE
url User cover image url- See Also:
- Constant Field Values
-
PROFILE_URL
public static final String PROFILE_URL
url User's Weibo unified URL address- See Also:
- Constant Field Values
-
DOMAIN
public static final String DOMAIN
string User's personalized domain name- See Also:
- Constant Field Values
-
WEIHAO
public static final String WEIHAO
string User's weihao number- See Also:
- Constant Field Values
-
GENDER
public static final String GENDER
string Gender, m: male, f: female, n: unknown- See Also:
- Constant Field Values
-
FOLLOWERS_COUNT
public static final String FOLLOWERS_COUNT
int Number of fans- See Also:
- Constant Field Values
-
FRIENDS_COUNT
public static final String FRIENDS_COUNT
int Number of followers- See Also:
- Constant Field Values
-
STATUSES_COUNT
public static final String STATUSES_COUNT
int Weibo number- See Also:
- Constant Field Values
-
FAVOURITES_COUNT
public static final String FAVOURITES_COUNT
int Number of favorites- See Also:
- Constant Field Values
-
CREATED_AT
public static final String CREATED_AT
string User creation (registration) time- See Also:
- Constant Field Values
-
FOLLOWING
public static final String FOLLOWING
boolean Not supported yet- See Also:
- Constant Field Values
-
ALLOW_ALL_ACT_MSG
public static final String ALLOW_ALL_ACT_MSG
boolean Whether to allow everyone to send me a private message, true: yes, false: no- See Also:
- Constant Field Values
-
GEO_ENABLED
public static final String GEO_ENABLED
boolean Whether to allow identification of the user's geographic location, true: yes, false: no- See Also:
- Constant Field Values
-
VERIFIED
public static final String VERIFIED
boolean Whether it is a Weibo authenticated user, that is, a V-user, true: yes, false: no- See Also:
- Constant Field Values
-
VERIFIED_TYPE
public static final String VERIFIED_TYPE
int Not supported yet- See Also:
- Constant Field Values
-
REMARK
public static final String REMARK
string User note information, this field is only returned when querying user relationships- See Also:
- Constant Field Values
-
STATUS
public static final String STATUS
object User's recent Weibo information field- See Also:
- Constant Field Values
-
ALLOW_ALL_COMMENT
public static final String ALLOW_ALL_COMMENT
boolean Whether to allow everyone to comment on my Weibo, true: yes, false: no- See Also:
- Constant Field Values
-
AVATAR_LARGE
public static final String AVATAR_LARGE
string User avatar address (larger image), 180 × 180 pixels- See Also:
- Constant Field Values
-
AVATAR_HD
public static final String AVATAR_HD
string User avatar address (HD), HD avatar original- See Also:
- Constant Field Values
-
VERIFIED_REASON
public static final String VERIFIED_REASON
string Reason for certification- See Also:
- Constant Field Values
-
FOLLOW_ME
public static final String FOLLOW_ME
boolean Whether the user is concerned about the currently logged in user, true: yes, false: no- See Also:
- Constant Field Values
-
ONLINE_STATUS
public static final String ONLINE_STATUS
int User's online status, 0: not online, 1: online- See Also:
- Constant Field Values
-
BI_FOLLOWERS_COUNT
public static final String BI_FOLLOWERS_COUNT
int User's mutual powder count- See Also:
- Constant Field Values
-
LANG
public static final String LANG
string User's current language version, zh-cn: Simplified Chinese, zh-tw: Traditional Chinese, en: English- See Also:
- Constant Field Values
-
-
Method Detail
-
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<WeiboProfile,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 WeiboProfile extractUserProfile(String body) throws HttpAction
Description copied from class:OAuthProfileDefinition
Extract the user profile from the response (JSON, XML...) of the profile url.- Specified by:
extractUserProfile
in classOAuthProfileDefinition<WeiboProfile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>
- Parameters:
body
- the response body- Returns:
- the returned profile
- Throws:
HttpAction
-
-