We need to access API Gateway application Identifier Claim set in REST Service on Integration server.
Reason:
We need to set some key/value pairs that will remain hidden from consumer but need to access those mapping in REST Service.
Scenario:
For example “LabelNumber” will be different for each consumer. Once request is authenticated in API Gateway, we need to pass LabelNumber to REST API for all the methods. But this number cannot be shared with consumer.
We are using API Portal and API Gateway advanced edition version 10.3.
Hi,
You can use the application rest service (<host:port>/rest/apigateway/applications/<<app_id>>) and then extract the identifiers field from the response.
Note: For the JWT claims, the value will be in JSON format you need to parse it and extract the actual value for a key.
How do I get app_id @ runtime?
We don’t want to ask consumer to pass app_id with access token.
This(apigateway.applications:getApplication) runs properly if we run on browser using invoke or rest. But it fails everytime when we call it from flow service in IS.
Error:
Could not run ‘getApplication’
java.lang.RuntimeException: com.wm.data.ISMemDataImpl cannot be cast to com.wm.util.Values
Hi Vineet,
No its good, i would suggest few small things.
To check for JWT Claims (appIdentifier.getKey() == “jwtClaims”) so that even if other identifiers are also available it shouldn’t be a problem.
You are destroying the ClaimsCursor.destroy(); earlier inside the loop.
Also I assume defining one claimSet would solve your usecase. So I would suggest including the claimSet in the pipeline directly. So that even if by accident an application has a different claimSet name it shouldn’t cause a issue.