将用户从SQL ASP.NET Identity DB(社交帐户)迁移到Azure AD B2C时出错

时间:2018-10-05 18:35:07

标签: azure-ad-b2c azure-ad-graph-api

我们目前有一个ASP.NET Identity SQL数据库,用于存储应用程序的用户。我们正在使用社交登录名将这些用户迁移到Azure AD B2C。为了进行迁移,我们使用Azure AD Graph API在Azure AD B2C中创建新用户。通过API可以很好地创建一些用户,而其他用户则失败并显示以下消息:

{
    "odata.error": {
    "code": "Request_BadRequest",
    "message": {
        "lang": "en",
        "value": "Cannot convert a primitive value to the expected type 'Edm.Binary'. See the inner exception for more details."
    }
}

}

我没有在响应中找到内部异常的引用。在用户指南的外部,请求的内容几乎完全相同。

工作:

{
    "accountEnabled": true,
    "extension_db9f0616c9d6431596003b40cbd4933d_Bio": null,
    "createdDateTime": null,
    "creationType": null,
    "displayName": "SomeUserName",
    "givenName": null,
    "extension_db9f0616c9d6431596003b40cbd4933d_Institutions": null,
    "mailNickname": "69c16574-219b-4b88-84bc-426bbd9c19ed",
    "objectId": null,
    "extension_db9f0616c9d6431596003b40cbd4933d_SomeInternalIdString": null,
    "passwordPolicies": null,
    "passwordProfile": {
        "password": "NotNeeded1234!",
        "forceChangePasswordNextLogin": false
    },
    "signInNames": [],
    "surname": null,
    "userPrincipalName": "69c16574-219b-4b88-84bc-426bbd9c19ed@<our_tenant>.onmicrosoft.com",
    "userIdentities": [{
        "issuer": "microsoft.com",
        "issuerUserId": "<SomeIdString>"
    }],
    "extension_db9f0616c9d6431596003b40cbd4933d_Websites": null
}

失败:

{
    "accountEnabled": true,
    "extension_db9f0616c9d6431596003b40cbd4933d_Bio": null,
    "createdDateTime": null,
    "creationType": null,
    "displayName": "SomeUserName",
    "givenName": null,
    "extension_db9f0616c9d6431596003b40cbd4933d_Institutions": null,
    "mailNickname": "c395b301-b19e-4f2e-adbc-29035045fb8a",
    "objectId": null,
    "extension_db9f0616c9d6431596003b40cbd4933d_SomeInternalIDString": null,
    "passwordPolicies": null,
    "passwordProfile": {
        "password": "NotNeeded1234!",
        "forceChangePasswordNextLogin": false
    },
    "signInNames": [],
    "surname": null,
    "userPrincipalName": "c395b301-b19e-4f2e-adbc-29035045fb8a@<our_tenant>.onmicrosoft.com",
    "userIdentities": [{
        "issuer": "google.com",
        "issuerUserId": "<id_from_AspNetUserLoginsTable>"
    }],
    "extension_db9f0616c9d6431596003b40cbd4933d_Websites": null
}

0 个答案:

没有答案