[OPENAM-13860] REST API "PUT /global-config/realms/{realmref}" broken Created: 26/Oct/18  Updated: 03/May/19  Resolved: 03/May/19

Status: Closed
Project: OpenAM
Component/s: API descriptor
Affects Version/s: 14.0.0, 14.1.0, 14.1.1, 14.5.0, 14.5.1, 5.5.1, 6.0.0,,,,,, 6.5.0, 6.5.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Bernhard Thalmayr Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: API-Explorer
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Oracle JDK 1.8.0_151-b12
Apache Tomcat/9.0.8

Issue Links:
is related to OPENAM-13859 global-config/realms endpoint does no... Open
Rank: 1|hzx14v:
Support Ticket IDs:


Bug description

Updating DNS alias / realm aliases via REST endpoint "PUT /global-config/realms/{realmref}" is not possible

How to reproduce the issue

  1. Configure AM
  2. Use API explorer to retrieve realm config for root realm (
    curl -X GET --header 'Accept: application/json' 'http://am6004.test.xyz:8080/am/json/global-config/realms/Lw')
  3. Use API explorer so set DNS aliases / realm aliases
    curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
       "aliases": [ \ 
         "am6004.test.xyz", \ 
         "am600.test.xyz", \ 
         "openam", \ 
         "am6004" \ 
       ] \ 
     }' 'http://am6004.test.xyz:8080/am/json/global-config/realms/Lw'
Expected behaviour
new realm aliases / dns alias should be applied
Current behaviour
Reponse Code '500'
Response Body

  "code": 501,
  "reason": "Not Implemented",
  "message": "Cannot provide ID for Realm resource"

Comment by Peter Major [X] (Inactive) [ 26/Apr/19 ]

Looks like an If-Match: * header is missing from the above request.

Comment by Jonathan Thomas [ 03/May/19 ]

The following REST call is successful as outlined in docs:

 curl --request PUT --header "iplanetDirectoryPro: u..AA." --header "Content-Type: application/json" --header "Accept-API-Version: resource=1.0, protocol=1.0" --data '

{"parentPath": "/", "active": true, "name": "newRealm", "aliases": ["test.example.com","test2.example.com"]}



Where L25ld1JlYWxt is the _id of the realm


_id can be grabbed with the following REST call:


curl -request GET --header "iplanetDirectoryPro: u..AA."  --header "Accept-API-Version: resource=1.0, protocol=2.1" http://host2.example.com:8080/openam/json/global-config/realms?_queryFilter=true


Additionally tested on the root realm 

curl -v --request PUT --header "iplanetDirectoryPro: u..AA." --header "Content-Type: application/json" --header "Accept-API-Version: resource=1.0, protocol=1.0" --data '

{"name": "/", "active": true, "aliases": ["test.example.com","test2.example.com"]}

' http://host2.example.com:8080/openam/json/global-config/realms?_queryFilter=true

Comment by Jonathan Thomas [ 03/May/19 ]

Could not reproduce in 6.5.1 testing

Generated at Sat Feb 27 22:08:14 UTC 2021 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.