-
-
Save lexod/673800d57bd81c5ca3aed16c0a7fd36e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl --location --request POST '{{url}}/api/v1/users/{{userId}}/lifecycle/reset_password?sendEmail=false' \ | |
| --header 'Content-Type: application/json' \ | |
| --header 'Accept: application/json' \ | |
| --header 'Authorization: {{apiKey}}' \ | |
| --data '' | |
| var response = JSON.parse(responseBody); | |
| if(response.resetPassswordUrl) { | |
| postman.setEnvironmentVariable("stateToken", JSONResponse.resetPassswordUrl.split('/').slice(-1)[0]); | |
| } | |
| curl --location '{{url}}/api/v1/authn/recovery/token' \ | |
| --header 'Accept: application/json' \ | |
| --header 'Content-Type: application/json' \ | |
| --header 'Authorization: ••••••' \ | |
| --data '{ | |
| "recoveryToken": "" | |
| }' | |
| curl -X POST "{{url}}/api/v1/users/00u123abcXYZ456/credentials/change_password" \ | |
| -H "Authorization: ••••••" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "newPassword": { | |
| "value": "AdminSetPassword789!" | |
| } | |
| }' | |
| var response = JSON.parse(responseBody); | |
| if(response.stateToken) { | |
| postman.setEnvironmentVariable("stateToken", response.stateToken); | |
| } | |
| curl --location '{{url}}/api/v1/authn/credentials/reset_password' \ | |
| --header 'Accept: application/json' \ | |
| --header 'Content-Type: application/json' \ | |
| --header 'Authorization: {{apiKey}} \ | |
| --data '{ | |
| "stateToken": "{{stateToken}}", | |
| "newPassword": "Cha-cha-cha123" | |
| }' | |
| var response = JSON.parse(responseBody); | |
| if(response.sessionToken) { | |
| postman.setEnvironmentVariable("sessionToken", response.sessionToken); | |
| } | |
| if(response.stateToken){ | |
| postman.setEnvironmentVariable("stateToken", response.stateToken); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment