Don't get upn (unique primary name) in Azure AD authentication claims

I am using Azure AD Authentication for my WEB API Application and I can get both ClaimsPrincipal and Claims from the token, but I am not getting "upn" (" http://schemas.xmlsoap.org/ws/2005/05/identity/ claims / upn "), in the claims.

I need for an alias. Does anyone have an idea how I can get the claims.

+3


source to share


2 answers


You will only receive a UPN in a claim if you are a user of that Azure Active Directory, if you list it as another user in that directory, you will not receive a UPN in a claim.



For experiment, you can create a user in the directory with "New User in Organization" as the user type, and then try logging in with the new user and you will see that you will now receive a UPN. enter image description here

+1


source


If you don't get a UPN, you will most likely log in as an MSA account (Microsoft account formerly known as Live ID). Tokens issued for these accounts will not have a UPN claim. You can review the list of claims to see if any other claims might suit your needs.



+3


source







All Articles