# switchUser function in perspective

**URL:** <https://forum.inductiveautomation.com/t/switchuser-function-in-perspective/107418>\
**Category:** Ignition\
**Tags:** perspective, vision, ignition81, security\
**Created:** [June 16, 2025, 1:21pm UTC](https://forum.inductiveautomation.com/t/switchuser-function-in-perspective/107418 "2025-06-16T13:21:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_Braun](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Sebastian\_Braun](https://forum.inductiveautomation.com/u/Sebastian_Braun)\
**Post date:** [June 16, 2025, 1:21pm UTC](https://forum.inductiveautomation.com/t/switchuser-function-in-perspective/107418/1 "2025-06-16T13:21:26Z")

</div>

Hey,

I was using a switchUser function in vision through all of my projects so far, which enabled my projects to login/switch users, whenever a vadge was scanned.

Right now I am trying to recreate something like this in perspective. Therefore I just catch a string as keyboard input, which matches a regex expression and then a script SessionEvent-Script is triggered.  
Generally I am able to check if I could login with [system.security.validateUser](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-security/system-security-validateUser), but i cannot find a way to do the same, to actually log in as a user.  
I want to get rid of the login screen, where need to press any login button, and then again need to either use the badge or enter username and password, to authenticate towards the IdP.  
Just scan badge -\> logged in. 🙂

Kind regards

---

<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:** [June 16, 2025, 1:33pm UTC](https://forum.inductiveautomation.com/t/switchuser-function-in-perspective/107418/2 "2025-06-16T13:33:23Z")

</div>

Basically, you cannot.

Perspective relies on standardized Identity Provider technology, which has no method for scripting a login operation.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Braun](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Sebastian\_Braun](https://forum.inductiveautomation.com/u/Sebastian_Braun)\
**Post date:** [June 16, 2025, 1:43pm UTC](https://forum.inductiveautomation.com/t/switchuser-function-in-perspective/107418/3 "2025-06-16T13:43:50Z")

</div>

Okay, so what does the validateUser function do. Isn't this also authenticating towards the IdP?

---

<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:** [June 16, 2025, 3:47pm UTC](https://forum.inductiveautomation.com/t/switchuser-function-in-perspective/107418/4 "2025-06-16T15:47:40Z")

</div>

No. `validateUser` works against _user sources_, our "classic" authentication mechanism that's bespoke to Ignition. Identity providers are a standardized technology, not an Ignition invention.  
Ignition itself can act as a bridge IdP, using user sources as the backing source of authorization/authentication, which is the **only** situation in Perspective where `validateUser` would work.
