Password encryption in Rest Payload

saurabhchhajed
Kilo Explorer

Hi,
I am using rest API to create user on ServiceNow
and my playload is

{"user_name":"Watson",

"first_name":"John",

"last_name":"Whatson",

"email":"whatson@bcone.com",

"city":"Pune",

"department":"IT",

  "user_password":"pass,123"

}

when i run this it create the user on service now but it set the user_password as "pass,123" not as encrypted form so when i try to login with that password it says wrong password.
but when i get the user from servicenow it shaows me the password in encrypted form ie.

"user_password": "$s$AJFl3zx3LV/bClnko1qSKXDoavxl4zAHGqq5FzmJdQw=$2zgOx5fqrBM2t7uLJwKhO9Vi3hZkKNCF+M6o26Thh3I="
so i want to know how i encrypt my password and send it through payload or is there any other way to do this.

3 REPLIES 3

silas1
ServiceNow Employee
ServiceNow Employee

Hi Saruabh, what you're looking for is query param "sysparm_input_display_value=true":



/api/now/table/sys_user?sysparm_input_display_value=true



No need to encrypt the value yourself, the system will do it.



Hope this helps.


Hi, It's not working for me, it sill sets plain password not the encrypted and thus user login not working. Is there any changes?


tajhuque
Kilo Explorer

Was this ever resolved?   I'm facing a similar issue.