无法通过API连接到Azure AD B2C租户

时间:2020-04-09 14:47:54

标签: azure azure-active-directory azure-ad-b2c

我正在尝试按照here中的说明连接到我的Azure B2C租户。我正在使用邮递员复制Powershell调用。我能够成功获取对Azure Graph API的访问令牌。但是,当我尝试使用该令牌注册属性时,会收到以下错误:

{
    "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"
    }
}

我的请求的格式为:

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

有人可以帮我解决此请求吗?

1 个答案:

答案 0 :(得分:1)

这是令牌授权问题。在初始令牌请求和提交后续请求时,

contoso.onmicrosoft.com

必须替换为应用程序的特定域。