# Is it possible for AWX to map LDAP users to a different username based on domain?

**URL:** <https://forum.ansible.com/t/is-it-possible-for-awx-to-map-ldap-users-to-a-different-username-based-on-domain/45071>\
**Category:** Get Help\
**Tags:** ldap, awx\
**Created:** [January 8, 2026, 3:14pm UTC](https://forum.ansible.com/t/is-it-possible-for-awx-to-map-ldap-users-to-a-different-username-based-on-domain/45071 "2026-01-08T15:14:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [January 8, 2026, 3:14pm UTC](https://forum.ansible.com/t/is-it-possible-for-awx-to-map-ldap-users-to-a-different-username-based-on-domain/45071/1 "2026-01-08T15:14:34Z")

</div>

In AWX’s LDAP settings, one can point to multiple different LDAP authorities. Let’s say you have `domain1` and `domain2`, and you have a user named `user`. If `user` logs in via domain1 creds, they get a local account automatically created within AWX named `user`. If they log in with the same username via `domain2` creds, they still seem to utilize the local account automatically created within AWX named `user`.

Is there any way to alter the name of the local AWX username based off the LDAP service they logged in via? I searched but couldn’t find anything and AI halucinated a solution that didn’t work for me (editing “LDAP User Attribute Map” to map “username”).

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [January 8, 2026, 4:21pm UTC](https://forum.ansible.com/t/is-it-possible-for-awx-to-map-ldap-users-to-a-different-username-based-on-domain/45071/2 "2026-01-08T16:21:04Z")

</div>

May have found a workaround in keying off userPrincipalName instead of sAMAccount name in “LDAP user search” config. But curious if there is a solution to my original question.

---

<div class="post-metadata">

**Author:** ![U880D](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/u880d/32/10032_2.png) [@U880D](https://forum.ansible.com/u/U880D)\
**Post date:** [January 9, 2026, 11:18am UTC](https://forum.ansible.com/t/is-it-possible-for-awx-to-map-ldap-users-to-a-different-username-based-on-domain/45071/3 "2026-01-09T11:18:58Z")

</div>

> [@anon81884396](#):
>
> Is there any way to alter the name of the local AWX username based off the LDAP service they logged in via?

Since [AWX LDAP Authentication](https://docs.ansible.com/projects/awx/en/24.6.1/administration/ldap_auth.html) is using just [`django-auth-ldap`](https://pypi.org/project/django-auth-ldap/), you may read [Django Authentication Using LDAP](https://django-auth-ldap.readthedocs.io/en/stable/) for more information. According the documentation there, and as far as I understand, no, there seems to be no way out-of-box. Using an other key and as already mentioned should be the way to go.

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [January 9, 2026, 1:12pm UTC](https://forum.ansible.com/t/is-it-possible-for-awx-to-map-ldap-users-to-a-different-username-based-on-domain/45071/4 "2026-01-09T13:12:13Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 8, 2026, 1:13pm UTC](https://forum.ansible.com/t/is-it-possible-for-awx-to-map-ldap-users-to-a-different-username-based-on-domain/45071/5 "2026-02-08T13:13:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
