Hi @Like
Thank you for posting this in Microsoft Q&A.
UPN (User Principal Name) is a unique attribute in Microsoft Entra (Azure Active directory) that is used to authenticate the user. The UPN consists of a UPN prefix (the user account name) and a UPN suffix (a DNS domain name).
Name ID is a SAML attribute that is used to identify the user in a SAML assertion. It is not used for authentication, but rather for identification purposes. The Name ID can be any attribute that uniquely identifies the user, such as the employee ID, department, or surname. When a user logs in to a SAML-enabled application, the application receives a SAML assertion that includes the Name ID. The application can then use the Name ID to identify the user.
why users can authenticate even if they have the same department or surname
The Name ID is not used for authentication. Authentication is done based on the UPN, which is always unique. The Name ID is only used for identification purposes.
why users are authenticated with an email address and not with the UPN
Historically, the UPN was the primary identifier for authentication in Microsoft Entra ID, and for many organizations, the UPN was set to match the user's email address for a consistent sign-in experience. However, in some organizations, the UPN doesn’t match the preferred sign-in email (Primary SMTP address), which can create a less ideal login experience.
To address this, organizations can configure the Microsoft Entra UPN to match the user’s email address, allowing users to authenticate using their email address instead of the UPN. While this provides a better user experience, it may cause compatibility issues with certain Microsoft 365 workloads.
A more modern approach involves synchronizing the on-premises UPN with the user’s email address (via the ProxyAddresses attribute). This enables users to log in using their email address while maintaining synchronization between on-premises and Microsoft Entra ID. This flexibility ensures smoother authentication and accommodates different organizational requirements.
For your reference: https://learn.microsoft.com/en-us/entra/identity/authentication/howto-authentication-use-email-signin
Hope this helps. Do let us know if you any further queries.
Thanks,
Navya.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.