wonderful world
wonderful world

Reputation: 11599

How to update a users properties in Azure AD B2C programmatically?

I created a Azure AD B2C Tenant. I registered an application which is an Angular application. I updated the Angular application with the ClientId and other credentials to bring up a new sign in / register policy popup dialog. It is working fine and I can see the user in the Azure AD B2C directory.

I want to access that user and update a custom property that I added called Membership to ReadOnly. The Azure Portal UI does not show this custom property to be updated though it shows other properties like First Name, Last Name etc...

The documentation here says that I can programmatically update the properties of a user. This document is updated in 2017 and not up-to-date. I don't see any option in the Application in the Azure AD B2C Tenant to add permissions to CRUD operations on the user.

How can I update the properties of a user programmatically if I can't modify though the UI?

*************** UPDATE *************

I have a default directory and another directory where the B2C tenant lives. The billing of the B2C tenant is associated with the default directory. The application registrations in the default directory show some unknown applications that I don't know. The other non-default directory shows the applications. But I see an error saying I have to use the Application Registrations Legacy to see them. When I go to the Application Registrations Legacy, I don't see the app that I registered and I see b2c-extensions-app. Do not modify. Used by AADB2C for storing user data. This app has a settings menu.

The following steps are incorrect. I don't see any Settings menu.

The document says (1) Continuing in the Azure portal's App Registrations menu, select your application. (2) In the Settings menu, click on Required permissions.

Upvotes: 2

Views: 1308

Answers (1)

rbrayb
rbrayb

Reputation: 46700

That article is correct and points to a good GitHub utility that shows you how to do this.

Refer to the "Use custom attributes" section.

Note that custom attributes (called extension attributes) have the form:

extension_55dc0861f9a44eb999e0a8a872204adb_Jersey_Number

when updating programmatically.

The GUID is the ID of the B2C Extensions Application.

You can get this from the utility via:

b2c Get-B2C-Application

"Get the B2C Extensions Application in your B2C directory, so you can retrieve the objectId and pass it to other commands".

Or you can access the application directly in the Azure AD section of the B2C portal.

Upvotes: 1

Related Questions