# Script function to check if a user password has expired

**URL:** <https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278>\
**Category:** Ignition Early Access\
**Created:** [September 16, 2019, 9:25am UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278 "2019-09-16T09:25:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [September 16, 2019, 9:25am UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/1 "2019-09-16T09:25:45Z")

</div>

Is there any way to check if a user password has expired?, if not it would be great to implement it in a future release.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 16, 2019, 3:31pm UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/2 "2019-09-16T15:31:04Z")

</div>

What would you do with this information? Genuinely curious - something like implement your own reset screen? Or send a notification somewhere?

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [September 16, 2019, 4:56pm UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/3 "2019-09-16T16:56:17Z")

</div>

Hi Paul,

Yes that’s right, I want to redirect users to a customized window where they could change their passwords through the User Management Component once these passwords have expired.

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [September 24, 2019, 12:04pm UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/4 "2019-09-24T12:04:42Z")

</div>

Hi Paul,

What do you think about my request?, implementing it would be great, since managing password expiration when using customized windows for logging in is a real pain in the neck

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 24, 2019, 7:04pm UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/5 "2019-09-24T19:04:20Z")

</div>

Well, the trick is that our authentication is a bit in flux right now - we’re going to move everything (including Vision) over to the identity-provider mechanism used in Perspective in 8.0, and there are some technical hurdles to detecting things like this. We also _generally_ try to avoid things that only work with one “type” of something - we can easily detect an expired password with an internal user source, but might not be able to for an active directory source (depending on how it’s configured).

I would say, post to [ideas.inductiveautomation.com](http://ideas.inductiveautomation.com). The more community interest we see, the more we’ll prioritize work on particular features.

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [September 25, 2019, 9:59am UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/6 "2019-09-25T09:59:48Z")

</div>

Thank you for your answer Paul.

How can we detect an expired password when using an internal user source?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 17, 2019, 9:33pm UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/7 "2019-10-17T21:33:24Z")

</div>

We don’t have any exposed mechanism to do so. You might be able to via some SDK methods, but it would be fairly fragile. Another option would be to use a custom module so you’ve got “sanctioned” access to the gateway context.

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [September 8, 2021, 8:05pm UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/8 "2021-09-08T20:05:54Z")

</div>

Hey Paul,

I was looking through the SDK for 8.1, and I have not found any references to a method that lets me know that a particular user in an internal user source has an expired password.

Can you please point me to a method as I would like to look into creating a custom module to check this.

Thanks,  
Brandon

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 8, 2021, 9:32pm UTC](https://forum.inductiveautomation.com/t/script-function-to-check-if-a-user-password-has-expired/28278/9 "2021-09-08T21:32:31Z")

</div>

The `InternalUserRecord` class has a `com.inductiveautomation.ignition.gateway.authentication.records.InternalUserRecord#PasswordDate` field. You would compare that against the max age set on the user source.
