# Badge-based Authentication Support

**URL:** <https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144>\
**Category:** Ignition Early Access\
**Created:** [September 10, 2019, 4:28pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144 "2019-09-10T16:28:02Z")\
**Posts on this page:** 16\
**Page:** 3

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [May 25, 2021, 3:32pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/43 "2021-05-25T15:32:45Z")

</div>

> [@Thangakumar.S](#):
>
> Hi I used a barcode scanner to scan the badge(TB790) in gateway web interface but am unable to login whether any other hardware or any modules reqd to do it…

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

> [@jspecht](#):
>
> During authentication, the user will be prompted to scan their badge. The authentication web app listens for badge scans in the form of keyboard input. The signal for the end of input is the new line character, so be sure to configure your badge readers accordingly. The input buffer is automatically cleared after 1 second from the first input character allowing the user to try again if there was some problem during the scan.

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

---

<div class="post-metadata">

**Author:** ![rbachman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbachman/32/43718_2.png) [@rbachman](https://forum.inductiveautomation.com/u/rbachman)\
**Post date:** [March 31, 2022, 4:22pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/44 "2022-03-31T16:22:22Z")

</div>

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”.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/c/6cf3a1e6323e38f8335303e8f855e2b5d1daa607.png)

---

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [April 1, 2022, 2:52am UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/45 "2022-04-01T02:52:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [April 1, 2022, 4:22pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/46 "2022-04-01T16:22:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [April 1, 2022, 6:35pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/47 "2022-04-01T18:35:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wg1](https://avatars.discourse-cdn.com/v4/letter/w/96bed5/32.png) [@wg1](https://forum.inductiveautomation.com/u/wg1)\
**Post date:** [June 16, 2022, 1:21pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/48 "2022-06-16T13:21:09Z")

</div>

Bumping this thread in agreement. 🙂

---

<div class="post-metadata">

**Author:** ![Ryan\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ryan\_Shaw](https://forum.inductiveautomation.com/u/Ryan_Shaw)\
**Post date:** [July 21, 2023, 2:41pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/49 "2023-07-21T14:41:20Z")

</div>

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

```auto
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.

```auto
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?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 21, 2023, 2:49pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/50 "2023-07-21T14:49:36Z")

</div>

Try:

```python
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)

```

---

<div class="post-metadata">

**Author:** ![Ryan\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ryan\_Shaw](https://forum.inductiveautomation.com/u/Ryan_Shaw)\
**Post date:** [July 21, 2023, 2:53pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/51 "2023-07-21T14:53:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 21, 2023, 2:57pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/52 "2023-07-21T14:57:16Z")

</div>

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](https://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.12/com/inductiveautomation/ignition/common/messages/UIResponse.html)

---

<div class="post-metadata">

**Author:** ![Ryan\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ryan\_Shaw](https://forum.inductiveautomation.com/u/Ryan_Shaw)\
**Post date:** [July 21, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/53 "2023-07-21T15:09:37Z")

</div>

```auto
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?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 21, 2023, 3:16pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/54 "2023-07-21T15:16:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ryan\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ryan\_Shaw](https://forum.inductiveautomation.com/u/Ryan_Shaw)\
**Post date:** [July 21, 2023, 3:20pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/55 "2023-07-21T15:20:58Z")

</div>

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](https://docs.inductiveautomation.com/display/DOC81/system.user.editUser)).

---

<div class="post-metadata">

**Author:** ![Francisco\_Ochoa](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@Francisco\_Ochoa](https://forum.inductiveautomation.com/u/Francisco_Ochoa)\
**Post date:** [July 22, 2024, 6:38pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/56 "2024-07-22T18:38:02Z")

</div>

[![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/754c40a20850d197ab17d3c532673bf31b136553.png) ](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/754c40a20850d197ab17d3c532673bf31b136553.png)  
this window , where is manual mode?

---

<div class="post-metadata">

**Author:** ![Eike\_H](https://avatars.discourse-cdn.com/v4/letter/e/b38774/32.png) [@Eike\_H](https://forum.inductiveautomation.com/u/Eike_H)\
**Post date:** [February 5, 2025, 2:43pm UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/57 "2025-02-05T14:43:52Z")

</div>

I am trying to use a keyboard emulator and am succeding with entering a Badge number in the user profile and also read it in the log on page. Nevertheless, there is an error comming up that the badge could not be found. Going into developer tools, I can see that the pure string value is the same in both pages. Any idea where to look at to solve it? (Using [mkapulica][NFC-UID-Keyboard-Emulator])

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 19, 2025, 1:38am UTC](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144/58 "2025-12-19T01:38:03Z")

</div>

I know this is old… but there is almost **0%** of any of this information in the OP in the user manual. Can this be included please?

(I’m pretty sure the only reference to badges is a one liner describing what the Badge field is attached to a user, and maybe one other brief reference)

[Previous page](https://forum.inductiveautomation.com/t/badge-based-authentication-support/28144.md?page=2)
