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

Add groups when creating a new users through admin endpoints

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • Minor
    • Resolution: Out of Date
    • 6.0.1
    • Backlog
    • Admin - REST API
    • None
    • NEW
    • NEW

    Description

      We try to create a user with predefined client- and realm roles and a group with the admin rest api. We want to assign the role 'billing' for client 'webapp', the realm role 'require_otp' and join group 'testGroup' on user creation.

      If we send the following request body to /realm/users we get a response 200 with the created user but if we check in the admin console, client roles, realm roles and the group is not assigned.

      Request body:

      {
        "username": "8_9",
        "attributes": {
          ...
        },
        "credentials": [
          {
            "type": "password",
            "value": "test"
          }
        ],
        "email": "8@email.com",
        "enabled": true,
        "realmRoles": [
          "require_otp"
        ],
        "groups": [
          "testGroup"
        ],
        "clientRoles": {
          "webapp": [
            "billing"
          ]
        }
      }
      

      Reproduce:

      1. Send a post request to /realm/users with the request body specified above
      2. Check the user in the admin console

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              seuh5 Sebastian Ühlin (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: