Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-19098

Updating user via admin REST API could lead to error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 15.0.0, 15.0.1, 15.0.2
    • Fix Version/s: None
    • Component/s: Admin - REST API, Core
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Try to update the user via the Keycloak Admin REST API with userProfileMetadata as nullable attribute.

      Show
      Try to update the user via the Keycloak Admin REST API with userProfileMetadata as nullable attribute.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW
    • [QE] How to address?:
      ---
    • [QE] Why QE missed?:
      ---

      Description

      Currently I am using the UserRepresentation class from the org.keycloak:keycloak-core:15.0.2 package in my java application.

      Updating the representation of a keycloak user can produce the following error:

      Unrecognized field "userProfileMetadata" (class org.keycloak.representations.idm.UserRepresentation), not marked as ignorable

      If you manually call the Admin REST API endpoint like /auth/admin/realms/dpaii/users/userId this also leads to the problem. I could figured out, that the the following body does not lead to this error
      {
      "id": "6f5eb04d-a109-4c5b-a94b-d6a94ff99d79",
      "username": "3100000001",
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@doe.com",
      "emailVerified": "true",
      "attributes": null
      }
       

      If you add the nullable userProfileMetadata like the following the above error occurs.

      {
      "id": "6f5eb04d-a109-4c5b-a94b-d6a94ff99d79",
      "username": "3100000001",
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@doe.com",
      "emailVerified": "true",
      "userProfileMetadata": null,
      "attributes": null
      }
      In detail, the error is a 400 Bad Request with the body

      Unrecognized field "userProfileMetadata" (class org.keycloak.representations.idm.UserRepresentation), not marked as ignorable

       

        Attachments

          Activity

            People

            Assignee:
            mitko Michal Hajas
            Reporter:
            theexiile1305 Michael Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: