Microsoft.Identity.Web Library
Microsoft.Identity.Web
Microsoft.Identity.Web version
2.11.1
Web app
Sign-in users
Web API
Protected web APIs (validating tokens)
Token cache serialization
In-memory caches
Description
Current Owin code looks for a very specific claims preferred_username and crash if not present
Reproduction steps
Use Owin ( test/devapps/asp.net MVC/OwinWebApp application ) on Azure AD B2C without this claims.
Error message
System.NullReferenceException
Id Web logs
No response
Relevant code snippets
This is the problematic webcode :
string name = context.AuthenticationTicket.Identity.FindFirst("preferred_username").Value;
Microsoft.identy.web.Owin/AppBuilderExtension.Cs
https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web.OWIN/AppBuilderExtension.cs#L180
Regression
No response
Expected behavior
Read the the claim name from the ClaimNameType name ?
Microsoft.Identity.Web Library
Microsoft.Identity.Web
Microsoft.Identity.Web version
2.11.1
Web app
Sign-in users
Web API
Protected web APIs (validating tokens)
Token cache serialization
In-memory caches
Description
Current Owin code looks for a very specific claims preferred_username and crash if not present
Reproduction steps
Use Owin ( test/devapps/asp.net MVC/OwinWebApp application ) on Azure AD B2C without this claims.
Error message
System.NullReferenceException
Id Web logs
No response
Relevant code snippets
Regression
No response
Expected behavior
Read the the claim name from the ClaimNameType name ?