[OPENAM-12096] API explorer example for PUT on /global-config/services/scripting/contexts/{contexts}/engineConfiguration fails Created: 16/Nov/17  Updated: 07/Jun/18  Resolved: 07/Jun/18

Status: Resolved
Project: OpenAM
Component/s: API descriptor
Affects Version/s: 6.0.0
Fix Version/s: 6.5.0

Type: Bug Priority: Minor
Reporter: Andy Itter Assignee: Sean ONeill [X] (Inactive)
Resolution: Fixed Votes: 0
Labels: AME, Must-Fix
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
caused OPENAM-12353 Amster fails to export/import: 404 No... Closed
Target Version/s:
Rank: 1|hzux3b:
Sprint: Sprint 2017.15 Curie, Sprint 2017.16 Newton, Sprint 2017.17 Newton, Sprint 2018.1 Newton, Sprint 2018.2 Newton, Sprint 2018.3 Newton
Needs backport:
Support Ticket IDs:
Needs QA verification:
Functional tests:
Are the reproduction steps defined?:
Yes and I used the same an in the description


Bug description

The API explorer example for PUT on /global-config/services/scripting/contexts/{contexts}/engineConfiguration fails with a 400 Bad Request as it does not contain the

'Accept-API-Version: protocol=1.0,resource=1.0' header.

How to reproduce the issue

Use the API explorer with a PUT for the mentioned endpoint with the sample data.  In this case use OIDC_CLAIMS in the 'contexts' field in the API explorer parameters section for testing.

Expected behaviour
The sample in the API explorer should work
Current behaviour
400 Bad Request

Work around

Add the header


Comment by James Phillpotts [ 20/Nov/17 ]

The accept-api-version header shouldn't be required for this to work.

Comment by James Phillpotts [ 20/Nov/17 ]

Which sample was being tried for this? There's a create and an update.

Comment by James Phillpotts [ 20/Nov/17 ]

I think this might be because a BadRequestException response is being used for when a create PUT request is not supported, and the API Descriptor is doing an upsert style PUT request, which will try a create first, and then an update. By adding the header described, CREST has been dropped down to pre-upsert behaviour, so a create would never be attempted.

Comment by Andy Itter [ 20/Nov/17 ]

For the bug description: engineConfiguration in this case (which is what the XUI uses to update by the way) although engineConfiguration#_update appears to fails as well in the API explorer.

Comment by James Phillpotts [ 20/Nov/17 ]

I guess really that endpoint shouldn't be advertising itself as supporting create at all

Comment by Andy Itter [ 20/Nov/17 ]

Just to clarify further, in this case it was testing an update to the existing OOTB OIDC_CLAIMS. 

See Configure > Global Services > Scripting > Secondary Configurations > OIDC_CLAIMS > Secondary Configurations > EngineConfiguration in the admin XUI which uses the same endpoint to update with a PUT.

Comment by David Luna [ 20/Nov/17 ]

Should this endpoint support UPDATE, James Phillpotts?

Comment by James Phillpotts [ 20/Nov/17 ]


Comment by David Luna [ 12/Jan/18 ]

Now in PR: Removes CREATE and DELETE operations for:




as well as the associated advertisement in API descriptor.

Comment by Phill Cunnington [ 23/Jan/18 ]

It appears the change for this has prevented the UI from displaying the global scripts, Under Configure > Global Services > Scripting > Secondary Configurations.

Comment by Phill Cunnington [ 24/Jan/18 ]

Reverted original commit: https://stash.forgerock.org/projects/OPENAM/repos/openam/pull-requests/3909/overview

Generated at Sat Feb 27 03:42:25 UTC 2021 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.