I have an application that is in .net 4.7 and i am wanting to bring authentication over to use Azure AD from windows authentication. I have this working but i want to use User.Identity.Name which is currently null
I have seen that i can configure this somehow within startup.cs in configuration using NameClaimTypeReceiver
TokenValidationParameters = new TokenValidationParameters()
{
ValidateIssuer = false,
NameClaimTypeRetriever = OnNameClaimTypeRetriever
}
I cant see an example of writing this method anywhere OnNameClaimTypeRetriever
would you please be able to provide an example.
I am wanting to set it to OnPremisesSamAccountName which i can get via azure graph