Auth0 Home Blog Docs

"The audience is invalid"

audience-is-invalid

#1

Hi,

Since today 28 july 2017, I have an error when I log: "The audience is invalid"
Nothing change in my code, so I imagine that Auth0 changes something …
Now I try to find the solution, I look on the community:
https://community.auth0.com/questions/5433/how-to-change-the-default-audience
https://community.auth0.com/search?f=&type=question+OR+idea+OR+kbentry&redirect=search%2Fsearch&sort=relevance&q=audience+is+invalid
https://www.google.ca/search?q=auth0+“The+audience+is+invalid”&rlz=1C1CHBF_enCA743CA743&oq=auth0+“The+audience+is+invalid”&aqs=chrome..69i57.8287j0j4&sourceid=chrome&ie=UTF-8

From what I understand:
in https://manage.auth0.com/#/apis, i can see the list of audience
mine is xxx-dev
Then i need to change the default audience in https://manage.auth0.com/#/account then save
=> Doesnt work, the error is still there.

So i thought, maybe i need to change directly on the call:
Im using https://github.com/auth0/auth0.js for Angular Web App
in my auth0.ts file using for Angular4 i added in my WebAuth variable:

import { WebAuth } from ‘auth0-js’;
return new WebAuth({
audience: config.audience, //xxx-dev
domain: config.domain,
responseType: ‘token id_token’,
clientID: config.clientID,
redirectUri: redirectUri,
state: id
});

=> Doesnt work, the error is still there.

I really dont understand what happens … it s a total mystery. Is there someone who knows how to fix that?


#2

The audience parameter should be the value of the API identifier in the API settings. This can be seen in the API list from:

If you have confirmed that the audience value is set correctly, please capture a HAR file of the authentication request; please remove any passwords from the file, and upload it to a cloud storage service, and provide the share link restricted to @auth0.com email domains using Sharelock.io.

https://auth0.com/docs/har


#3