# Validate a user by password in perspective

**URL:** <https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617>\
**Category:** Ignition Early Access\
**Created:** [November 2, 2019, 5:45am UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617 "2019-11-02T05:45:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 2, 2019, 5:45am UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/1 "2019-11-02T05:45:31Z")

</div>

In vision I can validate a user by password by using \*\*system.security.validateUser(username, password, authProfile, timeout)  
In perspective is the other hand, the system.perspective.isAuthorized() can’t check the current login user password.  
I need this because after a user login in the system, I want each time the user want to send dangerous command, he is recheckef by the his password. In this way other operator which seat there can’t send the command if the current login operator left the control room for just a minute.(for example go-to WC)  
The system.perspective.isAuthorized() can’t get the current user password again to validate it.  
Is there any way to do this right now in perspective? for example access user password in session props.

---

<div class="post-metadata">

**Author:** ![Darshan\_Lad](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Darshan\_Lad](https://forum.inductiveautomation.com/u/Darshan_Lad)\
**Post date:** [February 17, 2022, 12:09am UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/2 "2022-02-17T00:09:27Z")

</div>

Hi Nader,  
Where you able to figure out how to do this ? If so, Do you mind sharing the workaround ?

---

<div class="post-metadata">

**Author:** ![dkylep](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dkylep](https://forum.inductiveautomation.com/u/dkylep)\
**Post date:** [February 18, 2022, 7:50pm UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/3 "2022-02-18T19:50:22Z")

</div>

You can get the current users user name from the session props.

Just have a ‘login pop-up view’ that is pre-populated with the current users user name, then have them re-enter the correct password. Then validate with `system.security.validateUser`

If they get the password right, execute the command.

```auto
	valid = False
	user = self.session.props.auth.user.id
	password = self.getSibling("PasswordField").props.text
	valid = system.security.validateUser(user,password)

```

You could even use the `system.security.getUserRoles(user, password)` command to double check that they have permission to execute the command

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [February 20, 2022, 2:08pm UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/4 "2022-02-20T14:08:01Z")

</div>

Yes the only way in perspective is to create a sqlite file and save user password in it so you can use it in future checking.

The system.security.validateUser only valid for vision as I remember

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 21, 2022, 7:55am UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/5 "2022-02-21T07:55:40Z")

</div>

> [@nader.chinichian](#):
>
> save user password in it

encrypted ofc

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 21, 2022, 1:28pm UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/6 "2022-02-21T13:28:57Z")

</div>

> [@victordcq](#):
>
> encrypted ofc

Salted and hashed, not encrypted.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 21, 2022, 1:49pm UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/7 "2022-02-21T13:49:51Z")

</div>

yes that is what i ment^^

---

<div class="post-metadata">

**Author:** ![Darshan\_Lad](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Darshan\_Lad](https://forum.inductiveautomation.com/u/Darshan_Lad)\
**Post date:** [March 2, 2022, 8:16pm UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/8 "2022-03-02T20:16:52Z")

</div>

Thanks Everyone for your inputs. I ended up getting it working usin system.security.validateUser function which is supported on Perspective.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [March 3, 2022, 4:33pm UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/9 "2022-03-03T16:33:04Z")

</div>

Oh really now it supported by perspective?  
But the docs scope section include only vision

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 3, 2022, 4:37pm UTC](https://forum.inductiveautomation.com/t/validate-a-user-by-password-in-perspective/29617/10 "2022-03-03T16:37:11Z")

</div>

The docs list the first signature as Vision Client, and the second as Gateway + Perspective Session… not sure if that’s intentional or not. I think it might be because the timeout parameter isn’t used on the gateway version.
