Azure AAD B2C: manage different datetime formats on custom claims

Stefano Sapienti 65 Reputation points
2023-04-17T14:30:46.1633333+00:00

Hi, I created a custom signup-signin policy in Azure B2C that asks the user for birth date. I store the date in a custom attribute named extension_birthday of type string.
We decided to use DateTimeDropdown as UserInputType and we found that if DataType of the claim is not "date" we receive an error creating final JWT, dunno why, if you have an idea it would be appreciated. Btw, the main problem is that we are integrating with a third party openid provider that returns birth date in DD/MM/YYYY format so, when we receive the JWT B2C raise the following error: "The date "24/2/1991" being used to initialize the instance is not in a recognized format." How it is supposed to handle this scenario? Is it possible to convert dates between different formats? Thanks in advance for the help.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,629 questions
{count} vote