2

I am new to Keycloak. I want create user using Keycloak admin REST API.

I have managed to create a user. But the problem is I also want to assign admin role to the user.

Attached is my JSON body. Can someone tell me what am I doing wrong here?

{
    "username":    "username",
    "email":       "user@gmail.com",
    "firstName":   "name1",
    "lastName":    "name2",
    "realmRoles":  [ "admin" ],
    "enabled":     true,
    "credentials": [{
        "type":     "password",
        "value":    "default",
        "temporary": false
    }]
}

Thank you in advance

iuhettiarachchi
  • 431
  • 1
  • 9
  • 24

0 Answers0