Luis Manez - MS MVP
Luis Manez - MS MVP

Reputation: 402

Azure AD B2C Custom Edit profile page

I'm working with Azure B2C from a MVC (4.6) WebApp and need to Edit Profile Policy with custom values coming from another system for a specific User profile property. (i.e: Favorite Categories, coming from a custom Categories table). I don't want to add all the possible categories to the User profile property settings in the Azure portal, cos values can change frequently. So, couple of questions:

1- Is there a way to tell Azure AD B2C Edit profile policy, what are the values to use for a specific user profile property?

2- Can I call the Edit Profile policy Endpoint to update the user profile?


For question #2, I'd have a custom page with the user profile properties, and I will update the user from code. I've "fiddled" the MS page, and it's doing a post to a specific endpoint, but I'm not able to make it work from code. I've also tried a bunch of different things.

The only approach that seems will work is to call the Graph API from code, following this article (but it requires to register another App from PowerShell, and also, execute the action with an App Token, instead of the current logged user): https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-devquickstarts-graph-dotnet

Upvotes: 3

Views: 2366

Answers (2)

Fei Xue
Fei Xue

Reputation: 14649

1- Is there a way to tell Azure AD B2C Edit profile policy, what are the values to use for a specific user profile property? (I don't think so)

No. All the users use the policy you config on the portal. We can create multiple profile edit policy and choose the right policy based on you business with custom code.

2- Can I call the Edit Profile policy Endpoint to update the user profile? that way, I'd have a custom page with the user profile properties, and I will update the user from code. I've "fiddled" the MS page, and it's doing a post to a specific endpoint, but I'm not able to make it work from code. I've also tried a bunch of different things.

No. It is impossible. As you mentioned, if you want to update the users profile programatically, the Azure AD Graph is recommend.

Upvotes: 2

user1005462
user1005462

Reputation: 332

you not able use JS, but you able customize with css; (enable cors to ms login domain on your web app etc) see msdm docs all are desribed; you able add custom properties in AD B2C to user sign up; so to edit profile should be possible too;

https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-reference-ui-customization

Upvotes: 0

Related Questions