我是 openIDM 的新手,我正在尝试执行以下查询,得到预期的正确结果,即 POST。
$ curl -k -s https://localhost/openidm/managed/zzzz?_action=create -H 'Content-Type: application/json' -H 'X-OpenIDM-Username: '"openidm-admin"'' -H 'X-OpenIDM-Password: '"openidm-admin"'' -H 'Accept: application/json' -d
'{ "x": "'"AA1"'", "xx": "'"xx"'", "xxx": "'"xxx"'","xxxx": "'"xxxx"'"}'
结果:
{"_id":"db0489f6-d390-481f-8708-0970b3e42469","_rev":"0","x":"AA1","xx":"xx","xxx":"xxx"," xxxx":"xxxx"}
但是我希望将 id 值创建为客户端分配的 ID,而不是由 openidm 生成的 ID,为此我使用如下 PUT 命令
$ curl -k -s PUT https://xxxx/openidm/managed/zzzz/AA1 -H 'Content-Type: application/json' -H 'X-OpenIDM-Username: '"openidm-admin"'' -H 'X-OpenIDM-Password: '"openidm-admin"'' -H 'Accept: application/json' -d '{ "x": "'"AA1"'", "xx": "'"xx"'", "xxx": "'"xxx"'","xxxx": "'"xxxx"'"}'
结果 :
{"code":400,"reason":"Bad Request","message":"无法创建资源实例 /managed/zzzz/AA1"}
输出我想要的是
{"_id":"AA1","_rev":"0","x":"AA1","xx":"xx","xxx":"xxx","xxxx":"xxxx"}
我不确定我做错了什么,有什么建议吗?我遵循了 openidm 文档,下面是该链接。
https://backstage.forgerock.com/docs/idm/5.5/integrators-guide/#about-crest-create