I have created a single page application, and initially using a python flask app I wrote logged in using the universal login, setting the audience and scope, using the Auth0 flask integration. This works and returns a JWT with the expected details.
I have tried to recreate in Flutter for a Web App. I have used:
package:auth0_flutter/auth0_flutter.dart
package:auth0_flutter/auth0_flutter_web.dart
And I can login the user from the universal login, however I cannot successfully set an audience or the scopes I require.
The code I have used is:
final Auth0Web auth0Web = Auth0Web(AUTH0_DOMAIN, AUTH0_CLIENT_ID);
This does not set the audience or scopes and the bearer token I get back is opaque.
Am I doing anything wrong, or have I missed a step somewhere, or is this a bug?
While it’s difficult for me to know what the issue could be in your app code, I was able to test this in our sample app and can confirm that I am receiving a JWT as opposed to an opaque token. Perhaps you can pull that down and configure to your own environment for comparison purposes?
My audience and scopes are defined in example_app.dart as follows: