# Need help on authenticationChallenge

**URL:** <https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 24, 2025, 2:06am UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698 "2025-06-24T02:06:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [June 24, 2025, 2:06am UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/1 "2025-06-24T02:06:21Z")

</div>

I am trying to implement the ability to limit a user to one session as in [Keep users from logging in on multiple devices - #23 by Eagel007](https://forum.inductiveautomation.com/t/keep-users-from-logging-in-on-multiple-devices/64013/23). Comment 22 mentions using authenticationChallenge with forceAuth = True.

I implemented the Perspective Startup event script as shown:

 ![ig_authenticationChallenge_2025-06-23 at 9.00.36 PM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f76e837820cad64a99774809cc38f60c79aeddac.jpeg)

In the log I see the script runs, but on the authenticationChallenge instruction I have an error:

 ![ig_authenticationChallenge_2025-06-23 at 8.53.52 PM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/6/4641741d78024c926f2016da65b4b279156568b3.jpeg)

It looks like the fundamental issue in the error message is "No perspective page attached to this thread."

How do I fix this?

(complete text of error code below)

[log\_authenticationchallenge.txt](https://forum.inductiveautomation.com/uploads/short-url/lQeSEpZhV5lATCse0WZRbKdbMHo.txt) (4.3 KB)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [June 24, 2025, 3:36am UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/2 "2025-06-24T03:36:58Z")

</div>

I think you have to pass the request from the session script via message handler to the perspective side before it gets the perspective context to be able to call it?

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [June 24, 2025, 1:06pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/3 "2025-06-24T13:06:00Z")

</div>

David, thanks for the reply. Can you show me the steps for making this work? I thought that a Perspective Startup script would already be on the Perspective side. Do I have the authenticationChallenge in the wrong place?

---

<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 24, 2025, 1:09pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/4 "2025-06-24T13:09:29Z")

</div>

> [@pdixon](#):
>
> Do I have the authenticationChallenge in the wrong place?

Yes. Anything in Perspective that does navigation or opens/closes popups needs to run in **page** scope, not just session scope. Consider running this in a global docked view.

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [June 24, 2025, 1:31pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/5 "2025-06-24T13:31:18Z")

</div>

Perhaps I am not understanding. The Session Startup Script is not doing navigation or opening/closing popups. It is trying to force authentication every time a user starts a Perspective session, even if they are logged in on another session. Do I need to move this to a View onStatup script for the designated home page instead?

---

<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 24, 2025, 1:36pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/6 "2025-06-24T13:36:29Z")

</div>

Authentication counts as navigation because the browser has to navigate to the IdP. So yes, move it to a view startup or related event. (Docks are good choices because they don't come and go.)

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [June 24, 2025, 2:04pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/7 "2025-06-24T14:04:50Z")

</div>

Well, looks like I can't put it in a view onStartup script. I am not sure where this should go now.

 ![Screenshot 2025-06-24 at 9.00.49 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/c/4cc60e1ad629b06145c35f685d33ddd1eba70479.jpeg)

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [June 24, 2025, 2:07pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/8 "2025-06-24T14:07:02Z")

</div>

Does it go on the 'root' onStartup script?

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [June 24, 2025, 2:08pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/9 "2025-06-24T14:08:38Z")

</div>

Nope, same error on 'root' onStartup script

---

<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 24, 2025, 2:36pm UTC](https://forum.inductiveautomation.com/t/need-help-on-authenticationchallenge/107698/10 "2025-06-24T14:36:47Z")

</div>

"Designer sessions do not support auth challenges."

Don't attempt the auth challenge when already authenticated, to avoid loops and to avoid designer incompatibility.

You can only test a project's IdP in a proper client session.
