Hi experts,
Background
I am trying to make an authenticated call to an external resource from FSM. The authentication used is OAuth2 and the the data consumed and returned is in json. I initially attempted this using a routing rule with OAuth2ExtractHandler and JsonOutboundConnector, which is not working as the token extraction fails (I raised this here) . Now I’m trying a different approach.
- I make a dummy map to create a call to the authentication endpoint to retrieve the token.
- Then I store the token as a custom app param.
- I use the above custom param (which bears the token) to send authorized calls to resources.
Problem
I created the dummy map and routing rule as following,


This successfully gets the authentication token as following,

I created a custom app param and I’m trying to save the above retrieved token as the param value below

I tried the following approaches,
1. XML message in the process

As you can see I’ve used jsonpath to extract the access_token from the response, but this doesn’t extract the value as expected




If I just pass the {response} to the function(without filtering the jsonpath), the param value ends up being updated as empty.
3. I tried using the inbound map to capture the response,


This doesn’t update the cust app param record either. Perhaps the inbound map can only pick up xml responses?
So, Is there any way I could achieve what I’m aiming for?
Thanks in advance!
P.S : Apologies for the length of the post, I wanted to give as much information as possible.