DMop
DMop

Reputation: 483

Cannot connect to Azure AD B2C Tenant Via API

I am attempting to connect to my Azure B2C tenant using the instructions seen here. I am replicating the powershell calls using postman. I am able to successfully able to obtain an access token to the Azure Graph API. However, when I try to use that token to register an attribute I receive the following error:

{
    "odata.error": {
        "code": "Authorization_IdentityNotFound",
        "message": {
            "lang": "en",
            "value": "The identity of the calling application could not be established."
        },
        "requestId": "d9d7d7dd-f40e-4ed8-91b4-5c21dd4c7c0b",
        "date": "2020-04-09T14:35:36"
    }
}

My request is in the form:

POST /contoso.onmicrosoft.com/applications/**Object_ID**/extensionProperties?api-version=1.6 HTTP/1.1
Host: graph.windows.net
Authorization: Bearer **token**

----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="name"

requiresMigration
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="dataType"

Boolean
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="targetObjects"

["User"]
----WebKitFormBoundary7MA4YWxkTrZu0gW

Could someone help me troubleshoot this request?

Upvotes: 0

Views: 108

Answers (1)

DMop
DMop

Reputation: 483

This was a token authorization issue. On both the initial token request and when submitting subsequent requests,

contoso.onmicrosoft.com

must be replaced with your application's specific domain.

Upvotes: 1

Related Questions