To systems where JWTs are not the preferred or supported method for authentication and authorization. Here are a few reasons why you might choose to End User Attributes in the Absence of JWT Assertion.
Applications may not have implemented JWTs as part of their authentication and authorization process.
Some systems might have custom authentication solutions that don’t rely on standard token-based approaches like JWTs.
Walkthrough:
Creating sequence
Create a Sequence and save as XML file, this sequence will send the specified attributes as headers to the backend.
Add custom policy in API Manger
In API Manager Publisher Portal(https://localhost:9443/publisher), Navigate to your API.
Click On Policies >> Policy List >> Add New Policy
Add new policy (Name, Version, Upload Policy, Application Flows)
After adding the sequence save it. Apply policy to resource
Drag and drop policy from policy list to resource in request flow.
Next, click on save and deploy.
Testing API
Sign to the Developer Portal(https://localhost:9443/devportal) and click on API and Try Out.
To retrieve user attributes in MI backend
After api execution is success, we can retrieve the above mentioned properties at backend.
There are default properties to get the details of API’s and will be able to retrieve those using transport scope from MI as shown below.
<property expression=”$trp:AppNameAPIM” name=”AppName”/>
<property expression=”$trp:SYNAPSE_REST_API” name=”ApiName”/>
<property expression=”$trp:AM_KEY_TYPE” name=”AM_KEY_TYPE”/>
<property expression=”$trp:SYNAPSE_REST_API” name=”SYNAPSE_REST_API”/>
<property expression=”$trp:REST_FULL_REQUEST_PATH” name=”REST_FULL_REQUEST_PATH”/>
<property expression=”$trp:SYNAPSE_REST_API_VERSION” name=”SYNAPSE_REST_API_VERSION”/>
<property expression=”$trp:TRANSPORT_IN_NAME” name=”TRANSPORT_IN_NAME”/>
<property expression=”$trp:REST_API_CONTEXT” name=”REST_API_CONTEXT”/>
<property expression=”$trp:API_ELECTED_RESOURCE” name=”API_ELECTED_RESOURCE”/>
<property expression=”$trp:api.ut.application.id” name=”api.ut.application.id”/>
<property expression=”$trp:api.ut.hostName” name=”api.ut.hostName”/>
<property expression=”$trp:api.ut.HTTP_METHOD” name=”api.ut.HTTP_METHOD”/>
<property expression=”$trp:api.ut.consumerKey” name=”api.ut.consumerKey”/>
API details in MI
You can see in the console about the API calls
For more information, please write to [email protected].