# Client's "Login failed" red error popup window suppression

**URL:** <https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582>\
**Category:** Ignition\
**Created:** [December 14, 2012, 1:03pm UTC](https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582 "2012-12-14T13:03:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pilotek](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pilotek](https://forum.inductiveautomation.com/u/Pilotek)\
**Post date:** [December 14, 2012, 1:03pm UTC](https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582/1 "2012-12-14T13:03:59Z")

</div>

Please, is it possible to suppress the red popup Error window “Login failed” when operator enters invalid logname and/or password?

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [December 14, 2012, 4:19pm UTC](https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582/2 "2012-12-14T16:19:54Z")

</div>

No, they cannot be suppressed or turned off. The only way that you would be able to work around this is to have your own custom logon screen. You would set the project to auto logon in the project properties then have your own screen appear for the user to log in.

---

<div class="post-metadata">

**Author:** ![Pilotek](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pilotek](https://forum.inductiveautomation.com/u/Pilotek)\
**Post date:** [December 16, 2012, 1:18pm UTC](https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582/3 "2012-12-16T13:18:42Z")

</div>

Thank you Greg. Well, I already have auto logon and the red popup appears from my user login (small popup window translated from your Skeleton project’s “Switch User” label) anyway.

I think gateway throws this Error (and the red Error popup) anyway if login username or password are incorrect.

This would be no problem if all the system texts (in system menus, error popups…) could be translated. Otherwise (when the project has been made in another language) it looks not very professional when english popups are appearing.

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [December 17, 2012, 10:14am UTC](https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582/4 "2012-12-17T10:14:48Z")

</div>

There is an extra parameter on the system.security.switchUser function which allows you to suppress this error.

To try this, create your own custom login window as Greg suggested - make it the same size as your main window and put a text field, a password field and a login button on it. In the login button’s actionPerformed event put the following code:[code]username = event.source.parent.getComponent(‘txtUsername’)  
password = event.source.parent.getComponent(‘pwdPassword’)

success = system.security.switchUser(username.text, password.text, event, hideError=True)  
if success:

# Open up the appropriate main window - this can be user-specific if you want

```
system.nav.swapTo('Window1')

```

else:

# If the login didn’t work, give input focus back to the username component, so that the user can try again

```
username.requestFocusInWindow()
system.gui.errorBox("Login failed", "Error")[/code]You can now display whatever text you want on a failed login attempt.

```

If you are using auto login with a custom login window and are still displaying the Ignition menu at the top of the window, bear in mind that if the user presses Logout, the normal Ignition Login window will be displayed. You will have to edit the code behind the Logout button so it automatically logs in and displays your custom login window. Put code like the following into the Client Event Script for the Menubar Logout command:[code]# If the dummy “login” user is logged in, do nothing and exit  
username = system.tag.getTagValue("[System]Client/User/Username")  
if username == “login”:  
import sys  
sys.exit()

# Close all the open windows

for window in system.gui.getOpenedWindowNames():  
system.nav.closeWindow(window)

# Open the standard login window

system.nav.openWindow(“login”)

#Change the current user to the login user  
success = system.security.switchUser(‘login’, ‘login’)

# If the login didn’t work, warn the user - the should never happen!

if not success:  
system.gui.errorBox(“Logout failed.”)[/code]

---

<div class="post-metadata">

**Author:** ![Pilotek](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Pilotek](https://forum.inductiveautomation.com/u/Pilotek)\
**Post date:** [December 17, 2012, 3:04pm UTC](https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582/5 "2012-12-17T15:04:43Z")

</div>

AlThePal, thank you soooo much.  
I misunderstood what Greg wrote. I already had autologin and own small popup login window (from template Skeleton project only translated to our language) and red Error popup appeared anyway.

But I didn’t know the magic parameter ‘‘hideError=True’’.

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [December 17, 2012, 3:06pm UTC](https://forum.inductiveautomation.com/t/clients-login-failed-red-error-popup-window-suppression/5582/6 "2012-12-17T15:06:21Z")

</div>

You’re welcome 🙂
