Keycloak : unable to map user roles when creating user for api

◇◆丶佛笑我妖孽 提交于 2019-12-11 11:58:53

问题


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

来源:https://stackoverflow.com/questions/54567270/keycloak-unable-to-map-user-roles-when-creating-user-for-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!