Reputation: 1
We want to implement Oauth autentication in IBM API Connect.
Default Oauth API has POST Token as consumes Types application/x-www-form-urlencoded and form as paremeters aswel but we need to execute the call inside an IBM Default Invoke event which is not supported.
We tried to modify POST to a GET and execute a call like
But is not supported in Cloud. How can execute a token request inside a invoke execution.
Upvotes: 0
Views: 387
Reputation: 55
In a GatewayScript action before the invoke action, try the following:
context.message.header.set('Content-Type', 'application/x-www-form-urlencoded')
context.message.body.write('grant_type=client_credentials&client_id=client&client_secret=secret')
Else you can also use the urlopen module in GatewayScript.
Upvotes: 0