【发布时间】:2017-09-27 18:55:27
【问题描述】:
我正在尝试向 Azure AD GraphAPI 发出 POST 请求以在我的 AD B2C 租户中创建用户,但出现以下错误
"Error Calling the Graph API:
{
"odata.error": {"code": "Request_DataContractVersionMissing",
"message": {"lang": "en",
"value": "The specified api-version is invalid. The value must exactly match a supported version"}
}
我确实发送了版本,并且基于docs,它是受支持的。
1.6 版
本部分列出了 Graph API 版本 1.6 的更改。
Graph API 1.6 版引入了以下功能变化:
添加了对 Azure Active Directory B2C 本地帐户用户的支持。这涉及到 User 实体的新属性和新的复杂类型 SignInName 支持本地帐户登录到 Azure Active Directory B2C 租户。有关 Azure Active Directory B2C 的详细信息, 请参阅 Azure Active Directory B2C 文档。
[编辑] 提交json
{"accountEnabled":true,"signInNames":[{"type":"userName","value":"ausername"}],"creationType":"LocalAccount","displayName":"A display name","passwordProfile":{"password":"a password","forceChangePasswordNextLogin":true},"passwordPolicies":"policies","country":"MX","givenName":"Fstname","surename":"Lstname","department":"Dpt","jobTitle":"Title","mail":"mail@server.com","otherMails":[],"preferredLanguage":"es-MX"}
关于我为什么会收到错误的任何线索?
【问题讨论】:
-
可以分享提交的完整json吗? (显然更改密码等)
-
@spottedmahn 我将有效负载添加到问题中
-
我尝试提交你的 json,我得到了
Invalid value specified for property 'passwordPolicies' of resource 'User'. -
我删除了密码策略并得到了
Property 'mail' is read-only and cannot be set. -
我删除了邮件并收到了
One or more property values specified are invalid.
标签: azure azure-ad-b2c azure-ad-graph-api