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 Details

  • Constructor Details

    • WeiboProfileDefinition

      public WeiboProfileDefinition()

      Constructor for WeiboProfileDefinition.

  • Method Details

    • getProfileUrl

      public String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration)
      Retrieve the url of the profile of the authenticated user for the provider.
      Specified by:
      getProfileUrl in class OAuthProfileDefinition
      Parameters:
      accessToken - only used when constructing dynamic urls from data in the token
      configuration - the current configuration
      Returns:
      the url of the user profile given by the provider
    • extractUserProfile

      public WeiboProfile extractUserProfile(String body) throws org.pac4j.core.exception.http.HttpAction
      Extract the user profile from the response (JSON, XML...) of the profile url.
      Specified by:
      extractUserProfile in class OAuthProfileDefinition
      Parameters:
      body - the response body
      Returns:
      the returned profile
      Throws:
      org.pac4j.core.exception.http.HttpAction