You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-12-16 14:42:51

aziz
Member
Registered: 2021-03-30
Posts: 109

Change user's password

Hello Guys,

I tried to change user's password like this :

http://xxx/glpi/apirest.php/user/$user_id

using PUT

{"input" :{"password":"$new password"
    }}


and the response :
[
    {
        "$user_id": true,
        "message": ""
    }
]

and the new password is encrypted to sha1 but no changes are made. How should I do it guys ??
appreciate any help!

Last edited by aziz (2021-12-16 18:10:51)

Offline

#2 2023-02-26 01:31:15

zepfred
Member
Registered: 2023-02-26
Posts: 1

Re: Change user's password

Hey.

I solved the same problem by sending the password unencrypted and setting a second password field (maybe password confirmation?):

curl --location --request PUT 'https://url/apirest.php/User/16/' \
--header 'Session-Token: token' \
--header 'App-Token: token' \
--header 'Content-Type: application/json' \
--data '{
    "input": {
        "password": "teste123",
        "password2": "teste123"
    }
}'

Offline

Board footer

Powered by FluxBB