Forgot Password
High Level Overview
Flow Details
If a user forgot their password, they can use the forgot password flow to reset their password.
It involves 3 step flow
- Request a verification code and store it with the user id in the database, and an email will be sent with a link to the verification page.
- The user can either click on the link in the email or enter the verification code along with email.
- The above info will be sent to the server to change the password and if the code matches userId then password will be reset
In order to request the code, below endpoint can be used:
curl --request POST \
--url https://dev-iam.razi.ai/v1/authentication/users/password/reset-request/email \
--header 'Content-Type: application/json' \
--data '{
"orgId": "271296458001489512",
"email": "john.doe@example.com"
}'
Once user has retrived their code from email or clicked on link in email, they should enter their new password and code in the below endpoint:
curl --request PUT \
--url https://dev-iam.razi.ai/v1/authentication/users/password \
--header 'Content-Type: application/json' \
--data '{
"orgId": "271296458001489512",
"email": "john.doe@gmail.com",
"verificationCode": "XSR89TU",
"newPassword": "Secret@slidezAB"
}'
Depending on the mapping of userId and code, the password will be changed or an error will be returned.