Web Support for Flutter SDK now in beta
Support for the web platform has been the most requested feature for the new Flutter SDK. Lately we’ve been hard at work wrapping the SPA SDK to make it happen.
A few days ago we released v1.2.0-beta.0 with web support. Give it a try, we would love to hear your feedback. Learn more
Is there a way to login a user with their email and password and receive a token back using the authentication api. I am making the api call from a client app. Thanks in advance.
As you have shared your issue I would like to suggest …Firstly I say
Yes, it is possible to implement an authentication API that allows a user to log in with their email and password and receive a token in response. Here are the general steps for implementing such an API:
The client app sends a login request to the authentication API with the user’s email and password included in the request payload.
The authentication API checks the email and password against its database to verify the user’s identity.
If the email and password are correct, the authentication API generates an authentication token for the user and returns it in the response.
The client app receives the token and saves it, usually in local storage or a cookie, for future authenticated requests.
For subsequent requests that require authentication, the client app sends the token as an authorization header with each request.
The authentication API checks the token for validity and, if valid, allows the request to proceed.
The specifics of implementing this will depend on the technologies you are using for your API and client app. Popular authentication standards such as OAuth2 or JWT can be used for implementing token-based authentication. There are also many libraries and frameworks available for various programming languages that can simplify the implementation of authentication in your application. Hope so it will help you.
Hi @konrad.sopala , thanks for making the Web support for Flutter available. This is key for me to be able to use Auth0 in my project.
I was able to get the beta example app to run using
flutter run .. but thus far I have been unsuccessful in trying to get the example app to work from static serving. For example:
- Run flutter build web
- cd build/web
- python -m http.server 3000
The app will load, however the Web Auth Login button does not have any effect, and entering a username / password yields the following error in the JS console:
Uncaught MissingPluginException(No implementation found for method auth#login on channel auth0.com/auth0_flutter/auth)
This is even after replacing the relative auth0 module refs in pubspec.yaml with the 1.2.0-beta.0 ones.
Wondering if anyone has encountered similar / there is a fix for this. Thanks!
Hey there @tech-at-tmpt !
Can I ask you to raise it as a GitHub issue here: auth0-flutter/auth0_flutter at beta · auth0/auth0-flutter · GitHub and share the link to it here so we can ping repo maintainers and work on this with them directly? Thank you!
Perfect! I’ll ping the repo maintainers in a few minutes!