To successfully create users and expire their passwords through API calls, a specific procedure must be adhered to.
NOTE: This is just an example of utilizing the POSTMAN API client to make changes using Okta API. Please use these at an Admin's own risk, as the steps could change if Postman implements any changes to their product. All instructions are provided as is without warranty of any kind. Okta disclaims all implied warranties, including, without limitation, any implied warranties of fitness for a particular purpose. It is highly recommended to test the instructions below in a test/preview environment if possible.
- API
- User Creation
Prerequisites
- Postman configured for the org environment as described on the Test the Okta REST APIs using Postman article.
- An Okta Org.
- Okta Users API Collection imported into Postman.
For a user to be created and have its password expired, the user should be created first with a password and, on a subsequent call, have its password expired.
To achieve this, the following procedure is in place:
-
Set up the Postman app as described in the Test the Okta REST APIs using Postman article.
-
Import the Okta Users Collection found on the Okta Users API Collection Okta developer page.
-
Prepare the Create user with password, Create User with imported hashed password, or Create User with Password & Recovery Question. Be advised that the calls should be done with the
?activate=trueparameter or a subsequent Activate user for the user to be in an Active state.
-
Press Send to send the API. If successful, a 200 SUCCESS response will be received along with a schema of the user's proprieties.
-
Capture the field marked as
idfrom the previous call. -
Use the captured
idparameter as the{{userId}}variable in the Expire Password call that will be done to expire the password for the user.
-
The user will now be in a Password Expired state.
Related References
- Postman
- Test the Okta REST APIs using Postman
- Okta Users API Collection
- Create a user with a password
- Create a User with an imported hashed password
- Create User with Password & Recovery Question
- Activate user
- Expire Password
