Class Pac4jProfileMapper


  • public class Pac4jProfileMapper
    extends Object
    Since:
    8.4.0
    Author:
    Norman Lorenz
    • Constructor Detail

      • Pac4jProfileMapper

        public Pac4jProfileMapper()
    • Method Detail

      • fromFastJson

        public static org.pac4j.core.profile.UserProfile fromFastJson​(com.alibaba.fastjson.JSONObject jsonObject)
        Converts a given JSON object representation of a pac4j user profile back to a pac4j user profile. The JSON object is expected to contain the profile type, profile ID, client name, and raw profile attributes.
        Parameters:
        jsonObject - the JSON object containing the profile information
        Returns:
        a UserProfile instance created from the JSON data, or null if the input is null
      • toFastJson

        public static com.alibaba.fastjson.JSONObject toFastJson​(org.pac4j.core.profile.UserProfile pac4jProfile)
        Converts a given pac4j user profile to a JSON object representation. The JSON object contains the profile type, profile ID, client name, and raw profile attributes.
        Parameters:
        pac4jProfile - the pac4j user profile to convert
        Returns:
        a JSON object containing the profile information, or null if the input is null