Auto login based on client IP Address

I am wanting to setup an auto login based on the client IP address. Using if statements I can auto login the user and open the correct window for the client. It will become very cumbersome to keep up with as more clients are added. I have created a MySQL table setup with each clients IP address the username, login and startup window. How do I pull the info from the table to check the IP against the client IP then use the logon username, password and window?

Thanks!!
Rhett Motley

Hi Rhett,

You do a database query in your Client Startup Script. Like this:

ipAddress = system.tag.read("[System]Client/Network/IPAddress").value query = """SELECT username, password, window FROM client_users WHERE ipaddress=?""" userInfo = system.db.runPrepQuery(query,[ipAddress])[0] if system.security.switchUser(userInfo["username"],userInfo["password"]): system.nav.openWindow(userInfo["window"])
Best,

1 Like

Holy Scripting Bat Man! Its works.

Thanks!

1 Like

Of course it does. That is just the tip of the iceberg.

The number of things that you can do with scripting in Ignition is unlimited.

Best,

1 Like

Hi,
How are you doing the autologin for the client?
We have a multi-monitor project (7.) that utilises the AutoLogin function
(https://support.inductiveautomation.com/index.php?/Knowledgebase/Article/View/89/2/launch-project-to-multiple-monitors)
But want it to be based on IP Address.

I have tried overriding username/password properties etc, but nothing has worked so far…

Thanks
Scott