Short and handy Okta Workflows tips and tricks. Read the full series.
To find out when an Okta user’s password expires, calculate it from two values:
passwordChanged: when the user last changed their password. Itโs on the user object.maxAgeDays: how many days a password lasts. Itโs in the password policy atsettings.password.age.maxAgeDays. Get it with the Okta – Custom API Action:GET /api/v1/policies/{policyId}.
Use the Date & Time – Add card to add maxAgeDays to passwordChanged. The result is the expiration date. To get the days left, use the Date & Time – Difference card with the expiration date as the end date and the current time (from Date & Time – Now) as the start date.
A few things to keep in mind:
- This works for users whose passwords are managed by Okta. For Active Directory or LDAP users, the directory controls expiration.
- If
maxAgeDaysis 0, passwords never expire, so thereโs nothing to calculate. - If you have more than one password policy, make sure you use the one that applies to your users.
Okta Workflows resources
- ๐ New to Okta Workflows? The Getting Started with Okta Workflows page has all the resources to help you get started.
- ๐บ Like learning from videos? Watch Okta Workflows videos.
- โHave a question? Ask during community office hours or post on the community forum.
- ๐ฌ Want to learn from the community? Join the #okta-workflows channel on the Mac Admins Slack.
- ๐ Want to learn more about identity automation? Take the Okta Workflows training on Okta Learning.
Leave a Reply