Hi SAP Community,
We are trying to integrate with an API created in Integration Suite API management with the SAP Workflow service via HTTP destination created in the SAP BTP for the respective API.
SAP WorkFlow --> SAP BTP --> API (IS API Management) --> iFlow(IS) --> SAP ECC
We are able to achieve this end to end using API Key verification Authentication between SAP Workflow and HTTP destination created in BTP. However, we want to achieve the similar thing using OAuth2ClientCredenatials as well.
We have created 2 different APIs in an API product in the API Management.
API 1 - Used to generate the Token using API key, secret and grant_type parameters
API 2 - Main API pointing to the the iFlow. But this API has Pre-Flow defined in the policies to first verify the token (generated from the first API) and only then call the iFlow endpoint.
Above scenario is working when we test through Postman. We are able to generate the token from first API and using the token, we are able to call the next API which then hits the iFlow.
However, when we try the similar thing using the SAP Workflow Service, we get the below error:
The OAuth token request to URL '< API URL>' failed with HTTP status code 400 (Bad Request) and response body '{"ErrorCode" : "invalid_request", "Error" :"Required param : grant_type"}'
In the BTP, we have created 2 different HTTP destinations as explained below:
Destination 1 - It has the URL of the main API which points to the iFlow. This destination further calls HTTP destination 2 using an additional property "bpm.oauth.token".
Destination 2 - It has the URL of the API responsible for generating the token. In this we have provided the client ID and secret using Basic Authentication and passed the grant_type using additional properties.

Please let me know if any other detail is required from my end to analyze this issue further. Any help is much appreciated!