Problem statement
I have built a Flutter app for Web using the Auth0 SDK:
I have also configured New Universal Login in my tenant. And yet despite this, it seems that there is no method to call the Signup flow directly in Flutter apps. What do I need to do to give users access to Signup?
Solution
The Auth0 public documentation provides basic guidance on how to integrate your Flutter native or web application with Auth0, but in addition to this, you should also take time to explore the SDK documentation within the Github repository:
With reference to your specific problem, you can make users land directly on the Signup page instead of the Login page by specifying the 'screen_hint': 'signup'
parameter.
Note that this can be combined with 'prompt': 'login'
, which indicates whether you want to always show the authentication page or you want to skip if there’s an existing session. The various options are shown in the following table:
Usage of these options is described in the Github repo documentation:
The documentation on Github also describes a number of other options such as Scopes, Audience and working with your Custom Domain. Make sure you read that document, as it contains a great deal of valuable information.
If you follow these instructions to include Signup within your application but the app still does not work, this is most likely due to a misconfiguration error. Here are some commonly encountered problems:
- Make sure that the application type is configured correctly
- the Flutter for Web SDK assumes that the app is of type ‘spa’ in the Application Settings
- the Flutter for Native/Mobile assumes that the app is of type ‘native’ in the Application Settings
- The instructions for the Flutter for Web SDK specify the use of port 3000.
It’s possible that you might have attempted something like this:
await auth0Web.loginWithRedirect(
redirectUrl: 'http://localhost:8080';,
parameters: {'screen_hint': 'signup'})
However, if you are following the sample project then you have to set:
AllowCallback URL to: http://localhost:3000
Allowed Logout URLs to: http://localhost:3000
Allowed Web Origins to: http://localhost:3000
Check your code and configuration file to make sure that only port 3000 is referenced.