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);
When login is pressed I call:
{
return auth0Web.loginWithRedirect(
redirectUrl: WEB_URL,
audience: AUTH0_AUDIENCE,
scopes: AUTH0_SCOPES);
}
Where scope is along the lines of:
const Set AUTH0_SCOPES = {
‘openid’,
‘profile’,
‘email’,
‘access:Administration’
};
and Audience is:
const String AUTH0_AUDIENCE = “https://API”;
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?
Thank you for any and all help.