Oauth 2.0 authentication is throwing an error like access_denied, No audience parameter was provided

vivek chelpuri2
Tera Contributor

We are trying to integrate servicenow with solify with Oauth 2.0 as Outbound rest API integration. We have received the client ID and client secret and we have created Oauth provider profile but when we try to Get Oauth token, we are getting the below error message.

 

"OAuth flow failed. Verify the configurations and try again. Error detail:access_denied, No audience parameter was provided, and no default audience has been configured"

 

Please provide your insights on where we can provide the audience in ServiceNow.

 

 

6 REPLIES 6

Please update the Audience parameter in the OAuth Util script inclide as shown below.

vivekchelpuri2_0-1687159889048.png

 

Osterber
Tera Contributor

Hi

I had the same issue and ended up doing it like this.

so what i did was 

  • Created a New script Include callen OAuthCustomUtils
  • Copied the Example script from OAuthUtils
  • Added the requestParamMap.put("audience","https://WhateverURL.com"); under the function preprocessAccessToken: function(requestParamMap)
  • In the Application Registries Record add the new extended script in the OAuth API Script.
  • see attached file

Hope it works.