# Switch authentication method using button clicked in perspective

**URL:** <https://forum.inductiveautomation.com/t/switch-authentication-method-using-button-clicked-in-perspective/77934>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [August 16, 2023, 1:34pm UTC](https://forum.inductiveautomation.com/t/switch-authentication-method-using-button-clicked-in-perspective/77934 "2023-08-16T13:34:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 16, 2023, 1:34pm UTC](https://forum.inductiveautomation.com/t/switch-authentication-method-using-button-clicked-in-perspective/77934/1 "2023-08-16T13:34:45Z")

</div>

Hi Guys,

Does anyone know how to switch the authentication method?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/b/6b8da35831285fed41ea700fb4df2719b1adfb27.png)

In my case when I clicked on the button then two conditions when the condition is true then open the **username and password** screen like below

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/0/20ccf99dabb6b49f21af8c74c41f8af8777eab44.png)

When the condition is false then open **badge** on the below screen

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/2/827a9b7f226e341ef2878e6f3637a7253f90ff53.png)

Any idea how to set this in perspective?

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![Joshua\_Benjamin](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Joshua\_Benjamin](https://forum.inductiveautomation.com/u/Joshua_Benjamin)\
**Post date:** [August 29, 2023, 10:48pm UTC](https://forum.inductiveautomation.com/t/switch-authentication-method-using-button-clicked-in-perspective/77934/2 "2023-08-29T22:48:44Z")

</div>

Hi Priyanka,

Unfortunately, authentication happens before startup, which I believe is the soonest your condition would be able to run. Also gateway settings such as the IDP are not able to be changed on the fly within the project.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 30, 2023, 10:00am UTC](https://forum.inductiveautomation.com/t/switch-authentication-method-using-button-clicked-in-perspective/77934/3 "2023-08-30T10:00:02Z")

</div>

@Joshua_Benjamin Thanks for the response.
