Keycloak : unable to map user roles when creating user for api
Asked Answered
R

0

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":       "[email protected]",
    "firstName":   "name1",
    "lastName":    "name2",
    "realmRoles":  [ "admin" ],
    "enabled":     true,
    "credentials": [{
        "type":     "password",
        "value":    "default",
        "temporary": false
    }]
}

Thank you in advance

Rutheruthenia answered 7/2, 2019 at 6:9 Comment(1)
It is a bug in keycloak REST API, github.com/keycloak/keycloak/issues/9354.Adductor

© 2022 - 2024 — McMap. All rights reserved.