Different auto log-ins on same project

Hey guys,

Is it possible to have different auto log-ins for the same project. I know you can set up an auto login on the gateway but that will apply to every client. What if I just want a few clients here and there to auto login and show only the screen that applies to that area without making separate projects? Is there a way to pass a username and password by editing the .jnlp file on the client somehow? It's not that big of a deal, but would still be nice to do. (maybe this should be moved to the feature request section). Thanks!

My first guess would be in the client side scripting.

From what I read, the scripting doesn’t start running until you’ve logged into the client. So, I don’t think that will help me.


Like I said it was a guess.

Here is what I do and I have 10 clients running the same project, each that do slightly different things.
Configure the project to use a generic login, say [quote]it_ScadaGeneric[/quote]

In a script module, mine is named Startup, place the following code.

# This definition is for switching the SCADA user name.
# Note: This really only switches the representative login.
#		It does not change the OSUser login, which is what 
#		we base all dynamic properties off of.

def switchSCADAUser(userPassword):
	# Import the required definitions.
	from system.tag import getTagValue
	from system.security import switchUser
	# Get the OSUserName from the system tag set.
	osUser = getTagValue("[SYSTEM]Client\User\OSUsername")
	# Lookup to see if the userName begins with 'it_ScadaUser'.
	# 	This is done since we use SCADA based logins similar to 'it_ScadaUserXX'
	#	Where XX is a number 01, 02, 03, ...
	# 	We don't want to switch the user if it is not a SCADA generic, since it 
	#	will raise an ActiveDirectory wrong password error.
	if( osUser.find("it_ScadaUser") != -1 ):
		switchUser(osUser, userPassword)

#---END of switchSCADAUser() DEFINITION

Finally in a client startup script, make a call to the above definition.

# Switch the username

This changes the Ignition user name to what the operating system user name is. This may not be directly what you want, but it should get you started.

You have two strategies here:

  1. Have the project auto-login, and then using the client startup script to detect what machine you’re on (if possibel) and either open up the screens you want for the specific area or log back out or show a custom login window.

  2. Create projects specific to each area that auto login and then using their startup script redirect to the main project, passing the appropriate credentials and startup windows.

I like method 2 best, but both ways work.