ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests
问题 I have a default ASP.NET Core website created within Visual Studio 2017. I have chosen to authenticate using an Azure Active Directory. I run the site and can successfully login using an account in the Active Directory. I can retrieve Claim information provided by Active Directory, e.g. by calling the following line I get the 'name'. User.Claims.FirstOrDefault(c => c.Type == "name")?.Value; I want to add a custom claim - CompanyId = 123456 for the logged in user. I'm able to add a custom