【问题标题】:Defining a new user password through Keycloak REST API通过 Keycloak REST API 定义新的用户密码
【发布时间】:2020-02-07 19:17:38
【问题描述】:

我正在尝试通过 REST API 创建一个新用户,并且我正在发送此 POST

POST /admin/realms/myrealm/users

标题: 授权:Bearer(生成的token,这部分OK) 内容类型:application/json

正文:

{
    "username": "rahul",
    "enabled": true,
    "totp": false,
    "emailVerified": false,
    "firstName": "rahul",
    "lastName": "borse",
    "email": "rahulborse@yahoo.com",
    "credentials": [
        {
            "type": "password",
            "value": "rahul"
        }
    ]
}

用户创建正常,但密码无效,当我尝试 登录它声称我的凭据无效。

【问题讨论】:

    标签: keycloak keycloak-services


    【解决方案1】:

    尝试添加映射"temporary": falsecredentials

    {
        "username": "rahul",
        "enabled": true,
        "totp": false,
        "emailVerified": false,
        "firstName": "rahul",
        "lastName": "borse",
        "email": "rahulborse@yahoo.com",
        "credentials": [
            {
                "type": "password",
                "value": "rahul",
                "temporary": false
            }
        ]
    }
    

    【讨论】:

    • 您能否确认这是否有效?
    猜你喜欢
    • 1970-01-01
    • 2021-05-03
    • 2016-08-04
    • 2019-05-01
    • 2017-06-23
    • 2020-10-22
    • 2018-03-23
    • 2020-09-27
    • 1970-01-01
    相关资源
    最近更新 更多