0

I am trying to create an extension attribute in azure b2c for storing user's dateofBirth using Graph API. Getting below error when trying to use 'date' datatype: Request Body: { "name": "dateOfBirth", "dataType": "date", "targetObjects": ["User"] }

Response:"error": { "code": "Request_BadRequest", "message": "Invalid value specified for property 'dataType' of resource 'ExtensionProperty'.".

Is date not an accepted datatype for extension variables? Is there any alternate way to create extension attribute for custom policy?

1 Answers1

0

From official AD B2C document,

Choose a Data Type. Only String, Boolean, and Int are available.

I think for your case, you can create a string extension attribute and store the date as String. For the way to create string extension attribute, just refer to the above link of official document.

ray
  • 11,310
  • 7
  • 18
  • 42
  • Thanks. Yes since I have a requirement to split Date, Month & Year from the DateofBirth, it makes sense to store it as a string extension attribute. But can I still have a DateTimeDropdown on the UI for user to enter Date Of Birth field? I believe if extension attribute is of string type, only option is to show a textbox – user15436616 Mar 26 '21 at 15:29
  • That might be hard for out-of-the-box features. You might submit them as claims to your own RESTful API for processing and save it as String type using graph API. – ray Mar 27 '21 at 01:19