How to handle native API related OAuth token before routing stage

Hello Community
I would like to know what is preferred or easy way of getting native API related OAuth access token before actually invoking native API (in routing stage).

High level scenario example would be something like following:
I have created an API in API Gateway (v 10.11) which invokes some native API in routing stage. However in order to successfully invoke native API, I first need to get OAuth access token (using token url, client id & client credentials) and then I need to add retrieved access token to the request header (as bearer token) before actual invocation of Native API in routing stage.

How can I do that in API Gateway?

Should I try to execute some flow service in “Request Processing stage” (where the flow service will be responsible to get access token and add that token to request header as bearer token)?

Or is there any other better way of doing by using some different approach or transformation policy etc? Is there any built-in support in API Gateway where you can get OAuth token and add to request header during API execution (but before actual call to native API)?

Please guide me on this one based upon your prior or current similar experience. Thanks

hi @Mubarik ,
This use case can be achieved in multiple ways.
But one cleaner approach which i can think of is using the mashups.
We can get the OAuth token first and then same can be send to the native endpoints.

Please refer the below link for same:

Regards
Vikash Sharma

Thanks @Vikash_Sharma1 for your response. I will go through the article you shared. Thanks

Dear @Mubarik
I can recommend the following where I fork out a call to get an Oauth Token and inject the token in the native API call

1 - SoftwareAG webMethods API Gateway (Advanced) Tutorial | Orchestration of APIs in OAuth - YouTube

Best Regards,
Franklin

Thanks @franklinantony for your response. That was very helpful indeed.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.