# Is there a way to automatically login if SSO authentication fails?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-automatically-login-if-sso-authentication-fails/83581>\
**Category:** Ignition\
**Created:** [December 28, 2023, 6:48pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-automatically-login-if-sso-authentication-fails/83581 "2023-12-28T18:48:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbanzet](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cbanzet/32/6207_2.png) [@cbanzet](https://forum.inductiveautomation.com/u/cbanzet)\
**Post date:** [December 28, 2023, 6:48pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-automatically-login-if-sso-authentication-fails/83581/1 "2023-12-28T18:48:47Z")

</div>

I'm using v8.1.24 and I have SSO login working. I'd like to be able to automatically log a default user in if SSO authentication fails. The only thing I can think of is to put something in the client startup script, but it appears that that script only executes after the user logs in. To test I put the following code in the client startup script:

```auto
un = system.security.getUsername()
print "\r\n\r\nThis is the username: {}\r\n\r\n".format(un)

```

When I login on a machine where SSO didn't work, when I open the console, I see the username of the user I manually entered. Obviously I'm going to need something that executes before that. Any ideas?
