Oauth 2.0 authentication is throwing an error like access_denied, No audience parameter was provided
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2023 02:36 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 12:31 AM
Please update the Audience parameter in the OAuth Util script inclide as shown below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 01:59 AM
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.