我们目前有一个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
}