Class WechatProfileDefinition

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CITY  
      static java.lang.String COUNTRY
      country, For example, China is CN
      static java.lang.String HEADIMGURL
      User avatar, the last value represents the size of the square avatar (0, 46, 64, 96, 132 values are optional, 0 is 640 * 640 square avatar), the item is empty when the user has no avatar
      static java.lang.String NICKNAME  
      static java.lang.String OPENID  
      static java.lang.String PRIVILEGE
      User privilege information, json array, such as WeChat Waka users (chinaunicom)
      static java.lang.String PROVINCE  
      static java.lang.String SEX
      Gender, 1 male and 2 female
      static java.lang.String UNIONID
      User union identity.
      • Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition

        DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URL
      • Fields inherited from class org.pac4j.core.profile.definition.ProfileDefinition

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      WechatProfile 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.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SEX

        public static final java.lang.String SEX
        Gender, 1 male and 2 female
        See Also:
        Constant Field Values
      • COUNTRY

        public static final java.lang.String COUNTRY
        country, For example, China is CN
        See Also:
        Constant Field Values
      • HEADIMGURL

        public static final java.lang.String HEADIMGURL
        User avatar, the last value represents the size of the square avatar (0, 46, 64, 96, 132 values are optional, 0 is 640 * 640 square avatar), the item is empty when the user has no avatar
        See Also:
        Constant Field Values
      • PRIVILEGE

        public static final java.lang.String PRIVILEGE
        User privilege information, json array, such as WeChat Waka users (chinaunicom)
        See Also:
        Constant Field Values
      • UNIONID

        public static final java.lang.String UNIONID
        User union identity. For an application under the WeChat open platform account, the unionid of the same user is unique.
        See Also:
        Constant Field Values
    • Constructor Detail

      • WechatProfileDefinition

        public WechatProfileDefinition()
    • 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 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