Using Postman to make changes to signed-in user’s profile

prerequisites:

Azure AD B2C has an app.
This app should have these minimum permissions which you need to set:

Set up Postman to query for MS Graph API

ref – https://docs.microsoft.com/en-us/graph/use-postman

Open up Postman app.

Choose File | Import ….

Select Import From Link.

Paste the following two URLs and choose Import after each:

https://raw.githubusercontent.com/microsoftgraph/microsoftgraph-postman-collections/master/Microsoft%20Graph.postman_collection.json
https://raw.githubusercontent.com/microsoftgraph/microsoftgraph-postman-collections/master/Microsoft%20Graph.postman_environment.json

You should now see the Microsoft Graph environment in the top right environment drop down by the eye icon. Now you need to set up your environment.

Set up application API calls

Choose the No environment drop down in top right corner.

Select Microsoft Graph environment.

Choose the eye icon to the right and then choose Edit.

Enter your Microsoft Identity Application in the current (not initial) variables:
ClientID,
ClientSecret
TenantID.

When you created your app, it will have its own clientID and tenantID. For ClientSecret, just generate one like so:

Make sure you copy the secret onto a text, because after refresh, Azure will cover it.

Select Update.

Close the Manage Environments dialog box. In the MicrosoftGraph | Application collection on left side, choose
Get App-only Access Token.

Then choose Send.

You’ll get a App Access Token.

On the left sidebar, under Application, click on Get users. In your environment variables, make sure you copy and paste this App Access Token into the AppAccessToken variable.

Confirm that it is set under Bearer Token in Authorization tab.

Now you are ready to make changes to the user profile data.

On the left side, under Application | Users folder and choose Get Users.

The URL should be https://graph.microsoft.com/v1.0/users/ the HTTP method should be GET.

Then choose Send.

You’ll get a list of the users. Choose one user, and copy the id.

Changing the profile data

Now, on the top, change the HTTP method to PATCH. copy and paste the id at the end like so:

https://graph.microsoft.com/v1.0/users/302cd19a-6bd6-4cb0-a161-00cf925d8da7

Then choose Body tab. Select the raw radio button. Finally, choose JSON (application/json) for the pull down, which was originally defaulted to text.

Let’s say we want to change property displayName. We use JSON for this:

click send.