In Ionic/Cordova the Auth0.js library is not used to drive the main authentication flow and instead it’s more a helper library. For example, the Ionic 2 quickstart only uses the Auth0.js library to perform a call to the /userinfo endpoint; the actual authentication flow is performed through auth0-cordova.
With the above in mind, if your requirement is to pass additional parameters specific to the authentication flow then you’ll need to include those in association with auth0-cordova. In particular, you can provide a specific audience by including it as an additional property on the options object passed to the authorize method of Auth0 Cordova.
In the linked quickstart above you have the following options:
Thanks for the answer.
Adding this doesn’t change anything in my jwt, however adding the audience argument AND removing the scope argument does change the audience to the my audience. But this isnt a solution as the accestoken gets the value of the id token and the id token will become undefined.
Do you know what options I have left?
That is intriguing, I just saw the SO question and answer and I have to confess that I originally only looked at the code and since it documented the audience parameter I assumed it would just work… thanks for the follow-up and link to SO.