aad-auth icon indicating copy to clipboard operation
aad-auth copied to clipboard

Configurable username AAD attribute

Open nsballmann opened this issue 2 years ago • 5 comments

In https://github.com/ubuntu/aad-auth/blob/01c88d4ebaecd8ac0b79a44b678fe13f4b6de76f/README.md#L75-L80 we see, that the home folder path is configurable.

Can the username itself be configurable as well? IIRC currently the UPN is taken. In our company the UPN is changing in certain scenarios, therefore it's not ideal. This doesn't happen daily, but often enough to bug quite a lot of people. For example name changes due to marriage/divorce usually trigger this.

If we can configure, which user object attribute is being taken as user name, this would suit our needs better to provide a stable AAD wide unique username.

As a compromise, I think it's okay to identify the user by UPN during initial login. It just would be nice if the attribute (instead of the UPN) could be configurable determining the value to be taken when the users home dir is created and $USER is defined.

nsballmann avatar Apr 25 '23 17:04 nsballmann

In the current version, we don’t have access to any additional information from the MSAL API from the user. This is definitively on a longer term roadmap as your use case is definitively valid.

didrocks avatar Apr 27 '23 13:04 didrocks

This sounds like upstream MSAL is to be changed first. Can you give me pointers where to look at?

nsballmann avatar Apr 27 '23 14:04 nsballmann

Sure, we are using the Microsoft Go binding: https://github.com/AzureAD/microsoft-authentication-library-for-go. Note that for people with MFA, we need to have the whole MFA transaction succeeding first, we is on our roadmap.

didrocks avatar Apr 28 '23 04:04 didrocks

would it be possible to just user the "username without domain" as the username instead of the "[email protected]"?

boonedoggle avatar Dec 30 '23 01:12 boonedoggle

would it be possible to just user the "username without domain" as the username instead of the "[email protected]"?

In our companies EntraID tenant there are multiple domains so just the username would not be unique ([email protected] and [email protected]).

nsballmann avatar Jan 08 '24 09:01 nsballmann