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