1

I am trying to create a new user via the REST API, and I'm sending this POST

POST /admin/realms/myrealm/users

Headers: Authorization: Bearer (generated token, this part is OK) Content-Type: application/json

Body:

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

The user is created normally, but the password doesn't work, when I try to login it claims I have invalid credentials.

Rahul
  • 493
  • 3
  • 7
  • 25

1 Answers1

0

Try to add mapping "temporary": false to credentials:

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