How to include "audience" in OAuth 2.0 in webservice connector

My webservice application Authentication requires values passed for the following

grant_type - this is required and must pass the value client_credentials

client_id - xyz

client_secret - xyz

audience - xyz

How can I include “audience” in Oauth authenication.

Hi @Manju22

I’m not aware of a way to include the audience out of the box in the web service connector.

What I think you may need to do is select “Custom Authentication” and put your grant_type, client_id, client_secret, and audience all in a Custom Authentication operation.

Let me know if you have any questions or concerns on the approach.

1 Like

Thanks , But under Custom auth, I dont see in the Body to use “x-www-form-urlencoded”. How can I use that? Because my application Keys and values should be passed urlencoded in the body of the request.

I have added “Content-Type”: “application/x-www-form-urlencoded” in the header.But it doesnt help.

Try using the “Form Data” option in the Body. You should be able to reference it there by using the variables below:

$application.client_id$

$application.client_secret$

$application.audience$

$application.grant_type$

2 Likes

i.e. Instead of relying on the connector to do runtime URL encoding of the audience into the body, you might want to do static pre-encoded string instead.

Raw:
client_id=$application.client_id$&client_secret=$application.client_secret$&audience=$application.audience$

With those values pre-encoded by hand.