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 Details

  • Constructor Details

    • QQProfileDefinition

      public QQProfileDefinition()

      Constructor for QQProfileDefinition.

  • Method Details

    • getOpenidUrl

      public String getOpenidUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)

      getOpenidUrl.

      Parameters:
      accessToken - a OAuth2AccessToken object
      configuration - a OAuth20Configuration object
      Returns:
      a String object
    • 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 QQProfile extractUserProfile(String body)
      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
    • extractOpenid

      public String extractOpenid(String body)

      extractOpenid.

      Parameters:
      body - a String object
      Returns:
      a String object
    • extractParameter

      protected static String extractParameter(CharSequence response, Pattern regexPattern, boolean required) throws com.github.scribejava.core.exceptions.OAuthException

      extractParameter.

      Parameters:
      response - a String object
      regexPattern - a Pattern object
      required - a boolean
      Returns:
      a String object
      Throws:
      com.github.scribejava.core.exceptions.OAuthException - if any.