We need to integrate AzureAD authentication flow into our existing project. So I found the sample code available at here . It basically contains two web projects. A MVC project as Client and Web API as Server.
We though of using "upn" claim from JWT token to uniquely identify the logged in user. I ran the sample code and was able to authenticate the user in Azure AD. When i inspect the Access token i got from AAD at jwt.io the claims section doesn't contain the "upn" but i was able to retrieve the "upn" on the client using ClaimsPrincipal.Current.FindFirst(ClaimTypes.Upn)
. Added this access token as bearer authorization header and made a call to web api. Here I am not able to retrive the "upn" claim using ClaimsPrincipal.Current.FindFirst(ClaimTypes.Upn)
. The value is null for this claim. Do i need to do any additional configuration to get on server side. As of now I am able to retrieve upn only on the client side.