Badge-based Authentication Support

Take a look at this part of the first post in this thread:

As long as your barcode scanner can satisfy those requirements, you should be good.

I think this may be a feature request, but I’ll start with the question here in case it is already possible. We use Active Directory for authentication, and our badge information is stored as an attribute in AD. Is it possible to use “pure Active Directory” with an AD attribute rather than a query? We already have roles configured from AD, so it would require us to make fairly significant changes to try to move those roles into a separate database that we would query for the badge ID.

Just to be clear, I’m envisioning an extra field in the Advanced section for “Badge Attribute”.

1 Like

No - this is not currently possible, but we do have a ticket (IGN-4409) in our backlog to add a badge attribute and badge search filter (for badge based auth) to the Pure AD user source profile. I’ve linked this post to that thread.

3 Likes

For what it’s worth, this would be very useful to me also. I don’t see a specific entry for this in the Ideas Portal, so please count this as my vote of support for this feature.

2 Likes

I’ll throw my hat in for this one too.
We’ve got a few clients using badges and AD, and it’d be really cool to not have to manage an entire user-source just for badges.

5 Likes

Bumping this thread in agreement. :slight_smile:

2 Likes

I am using Ignition Vision 8.1.17 to test this function in a script console:

def addRoleIgnitionUser(username, badgeID, userDirectory='default'):
	user = system.user.getUser(userDirectory, username)
	if user:
		user.set('Badge', badgeID)
		system.user.editUser(userDirectory, user)
		print(user.get('Badge'))

addRoleIgnitionUser('ryan', 1234)

When I run it the first time, it prints '1234'. When I comment out user.set and system.user.editUser and run it again, i.e.

def addRoleIgnitionUser(username, badgeID, userDirectory='default'):
	user = system.user.getUser(userDirectory, username)
	if user:
		#user.set('Badge', badgeID)
		#system.user.editUser(userDirectory, user)
		print(user.get('Badge'))

addRoleIgnitionUser('ryan', 1234)

it prints None. It seems like the information I'm updating for the user is not being saved when I run system.user.editUser(). There are no errors in my console or Gateway logs. Am I missing something?

Try:

def addRoleIgnitionUser(username, badgeID, userDirectory='default'):
	user = system.user.getUser(userDirectory, username)
	if user:
		user.set(user.Badge, badgeID)
		system.user.editUser(userDirectory, user)
		print(user.get(user.Badge))

addRoleIgnitionUser('ryan', 1234)

Hi PGriffith.

Thank you for the reply. That did not work unfortunately. I followed the same procedure as before: I ran it once then commented out user.set and editUser and ran it again.

If you examine the UIResponse object returned by system.user.editUser, does it have any warnings/infos/errors?
https://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.12/com/inductiveautomation/ignition/common/messages/UIResponse.html

from com.inductiveautomation.ignition.common.messages import UIResponse

def addRoleIgnitionUser(username, badgeID, userDirectory='default'):
	user = system.user.getUser(userDirectory, username)
	if user:
		user.set('Badge', badgeID)
		print(UIResponse.getErrors(system.user.editUser(userDirectory, user)))

addRoleIgnitionUser('ryan', 1234)

Returns "You are not authorized to modify the Gateway system user source." I have the Admin role on the gateway, the project properties' "User Management" permission is also enabled. What else do I have to check?

'Allow User Admin' in the Gateway security settings:
https://docs.inductiveautomation.com/display/DOC81/Gateway+General+Security+Settings#GatewayGeneralSecuritySettings-GatewaySecuritySettingsTable

2 Likes

It worked, thanks! It might be a good idea to add that information to the documentation page for system.user.editUser() (system.user.editUser - Ignition User Manual 8.1 - Ignition Documentation).

1 Like


this window , where is manual mode?