Hello,
Is it possible to rename a Role Mapping rule using the Rest API?
When I attempt to rename a rule using a PUT call it returns a message saying the change was successful but it ends up creating a new rule with the new name and the old rules still exists. I could then delete the old rule with a DELETE call but I would rath just perform the rename in one call if possible. This way the rule numbers are maintained.
Here's what I've tried:
PUT to
/api/v1/configuration/users/user-realms/realm/test_realm/role-mapping-rules/rule/OLD_RULE_NAME
JSON object:
Array
(
[name] => New Rule Name
[roles] => Array
(
[0] => testrole
)
[stop-rules-processing] => true
[user-name] => Array
(
[test] => is
[user-names] => Array
(
[0] => testuser
)
)
)
Result:
Array
(
[result] => Array
(
[info] => Array
(
[0] => Array
(
[message] => Operation succeeded without warning or error!
)
)
)
)
I have also tried a PUT call to:
/api/v1/configuration/users/user-realms/realm/test_realm/role-mapping-rules/rule/OLD_RULE_NAME/name
using this JSON object:
Array
(
[name] => New Rule Name
)
It results in this error:
Array
(
[result] => Array
(
[errors] => Array
(
[0] => Array
(
[message] => [/configuration/users/user-realms/realm[name = "test_realm"]/role-mapping-rules/rule] Missing PolySelection ELEMENT
)
[1] => Array
(
[message] => [/configuration/users/user-realms/realm[name = "test_realm"]/role-mapping-rules/rule] Merge-Create: Create instance failed.
)
)
)
)
If there is a way to rename a rule in one shot please let me know.
Thanks!
Hi, bkoch.
Did you have any luck with your issue? I'm attempting to update the url-pattern of an access-url and getting a very similar error.
I'm doing a PUT on /api/v1/configuration/authentication/signin/urls/access-urls/access-url/xxxxxxxxx/url-pattern and getting...
HTTP/1.1 422 UNPROCESSABLE ENTITY Content-Type: application/json Content-Length: 321 { "result": { "errors": [ { "message": "[/configuration/authentication/signin/urls/access-urls/access-url] Missing PolySelection ELEMENT" }, { "message": "[/configuration/authentication/signin/urls/access-urls/access-url] Merge-Create: Create instance failed." } ] } }