# onAuthChallengeCompleted function not being run

**URL:** <https://forum.inductiveautomation.com/t/onauthchallengecompleted-function-not-being-run/98622>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 14, 2024, 5:01pm UTC](https://forum.inductiveautomation.com/t/onauthchallengecompleted-function-not-being-run/98622 "2024-11-14T17:01:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Patrick\_Whitlock](https://forum.inductiveautomation.com/u/Patrick_Whitlock)\
**Post date:** [November 14, 2024, 5:01pm UTC](https://forum.inductiveautomation.com/t/onauthchallengecompleted-function-not-being-run/98622/1 "2024-11-14T17:01:20Z")

</div>

Hello, I am trying to make a button that triggers a login, regardless if I am already logged into the session or not. If the login was successful, I want to write a value to a tag.

Currently, when the button is pushed, the login window prompts a login, but the 'authentication challenge completed' script never gets run.

Here is my button script:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c1ae15f676da3790ecd227c4818daca868ec5f7e.png)

Here is my authentication challenge completed script:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f0e4f358c7f9cda506a77b0dfbfceafef65131ad.png)  
Note that nothing gets written to the tag here, leading me to believe this function is not being run. I have triple checked the tag path to be correct.

---

<div class="post-metadata">

**Author:** ![Sean\_Carroll](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sean\_Carroll](https://forum.inductiveautomation.com/u/Sean_Carroll)\
**Post date:** [November 14, 2024, 9:00pm UTC](https://forum.inductiveautomation.com/t/onauthchallengecompleted-function-not-being-run/98622/2 "2024-11-14T21:00:50Z")

</div>

Yea I have been having issues with the auth challenge as well. Commenting to be in the loop if someone helps

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [November 15, 2024, 8:35pm UTC](https://forum.inductiveautomation.com/t/onauthchallengecompleted-function-not-being-run/98622/3 "2024-11-15T20:35:57Z")

</div>

After you attempt to login, are there any errors in the gateway logs? What version of ignition are you using? Are there any security limitations on the tag that you are attempting to write to?

Also, you are calling `value = payload['value']` in the auth challenge complete code, but I'm not seeing where a key called 'value' is being put into the payload from the button script, you only have `isAction:True`. At the very least I would expect you to find a dictionary `keyError` in your logs when attempting to run this event code.

Additionally, please post code, not pictures of code. It helps others try to troubleshoot code and is easier to read/see/copy.

> [@Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831):
>
> This thread is intended as a short help file for all those struggling to post formatted code on the forum. Code block formatting Posting formatted code on the forum (and most others) is as simple as selecting the code and pressing the \</\> button. It works the same as applying Bold or Italic styles to your document. It preserves indentation and applies syntax highlighting. [How to post code] Note that all the \</\> button does is add three backticks ``` on the line before the code block and anot…

---

<div class="post-metadata">

**Author:** ![Patrick\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Patrick\_Whitlock](https://forum.inductiveautomation.com/u/Patrick_Whitlock)\
**Post date:** [November 18, 2024, 1:35pm UTC](https://forum.inductiveautomation.com/t/onauthchallengecompleted-function-not-being-run/98622/4 "2024-11-18T13:35:48Z")

</div>

> [@ryan.white](#):
>
> After you attempt to login, are there any errors in the gateway logs?

Yup, turns out the logs revealed that the tag path was incorrect; it was missing the first '[' character in the path. Thank you for your help!
