FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Missing data.salution in /ouauth/userinfo which replaces /api/user

    Scheduled Pinned Locked Moved
    Release
    2
    2
    2.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kiouplidis
      last edited by

      In /api/user we had access to the data.saluation value.

      59139b87-7b12-4593-bb37-93d90b971756-image.png

      In oauth/userinfo this information is no longer available.

      df4e5a59-e710-41fe-9030-1e92252e82e7-image.png

      Where can we get this value now since we are forced to change to the new API because the old one will be sunset EOY.

      BR,

      mark.robustelliM 1 Reply Last reply Reply Quote 0
      • mark.robustelliM
        mark.robustelli @kiouplidis
        last edited by

        @kiouplidis I found this in the documentation.

        In version 1.50.0 and later, the UserInfo response can be customized with a lambda using the oauthConfiguration.userinfoPopulateLambda value of the application object. See UserInfo populate lambda.

        In FusionAuth, you can add custom data to the oauth2/userinfo endpoint response using a Lambda function. This function can add extra claims to the UserInfo response. Here's an example of a simple Lambda function that adds a few extra claims:

        function populate(userInfo, user, registration, jwt) {
          // Add a new claim named 'favoriteColor' from a custom data attribute on the user
          userInfo.favoriteColor = user.data.favoriteColor;
          // Add a new claim named 'dept' using a custom data attribute on the registration
          userInfo.dept = registration.data.departmentName;
          // Copy a claim named 'applicationId' from the provided JWT
          userInfo.applicationId = jwt.applicationId;
          // Create an event log of type 'Debug' when the lambda has Debug enabled
          console.debug('Added custom claims to the UserInfo response');
        }
        

        In this example, the favoriteColor and dept are custom claims added to the UserInfo response. These claims are derived from the custom data attributes on the user and registration respectively.
        Please note that the Lambda function needs to be assigned to an application in FusionAuth for it to take effect.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post