Closed
Description
Dear Firebase community,
I'd like to request for Authentication with only email (no password). I have some services users only vary rarely need to login and I don't want my users to set passwords. Just an email with a URL to login every time they want to login will do.
I think a lot of people would like this feature and there is currently a hack possible to achieve this, but I feel it'd be much better if this was an official option from Firebase.
Best regards,
-Luca Ban
Activity
mono0926 commentedon Mar 22, 2018
Now supported 🎉
https://firebase.google.com/support/release-notes/js#4.12.0
https://firebase.google.com/support/release-notes/ios#4.11.0
bojeil-google commentedon Mar 22, 2018
There are also sample codes for this for all 3 platforms:
https://github.com/firebase/quickstart-ios/blob/master/authentication/AuthenticationExample/PasswordlessViewController.m
https://github.com/firebase/quickstart-js/blob/master/auth/email-link.html
https://github.com/firebase/quickstart-android/blob/master/auth/app/src/main/java/com/google/firebase/quickstart/auth/PasswordlessActivity.java
mesqueeb commentedon Mar 23, 2018
Thank you very much!
forgr-owner commentedon May 31, 2018
@bojeil-google @mono0926 could we configure/customize the template who is send to the user ?
bojeil-google commentedon May 31, 2018
Currently this is not possible to prevent abuse.
ootpapps commentedon Jun 14, 2018
Thank you very much for the email only authentication and example.
I am struggling with the desktop experience and how to transition the user back to the app to complete the authentication flow. I understand the flow must be completed in-app, but I am struggling to address the risk that the user may jump to their desktop to confirm their email address.
Appears right now the only resolution would be to set up a webpage warning the user to click the email verification on the mobile device they began the authentication on... Is this correct?
Appreciated greatly.
bojeil-google commentedon Jun 14, 2018
The feature was designed to allow completion on any device. It is not restricted to a single device. But if you want to restrict it, you can set up a landing webpage to warn the user to open the link on the same device.
ootpapps commentedon Jun 15, 2018
Hi,
Thank you for the reply but I believe you misunderstood me. I don't want users to be restricted to a single device. How can I enable the email link to authenticate a user if they end up verifying their email via a desktop but started the authentication flow on a mobile device?
I am specifically referring to passwordless email sign-in only.
Thank you
bojeil-google commentedon Jun 15, 2018
Not sure I understand. If they open the link on a desktop device, they will be redirected to the continue URL that you own and passed. You would complete sign in there (you would need to ask the user for their email again for security reasons). The user will basically start the flow on a mobile device and ends up getting signed in on a desktop browser.
ootpapps commentedon Jun 15, 2018
bojeil-google commentedon Jun 15, 2018
I am not sure what to add but this option in the documentation specifies the landing page if the link is opened from a regular browser:
url: 'https://www.example.com/finishSignUp?cartId=1234',
On that page you can call the following logic to complete sign in:
ootpapps commentedon Jun 15, 2018
ootpapps commentedon Jun 19, 2018
bojeil-google commentedon Jun 19, 2018
If the flow ends up on a device different than the original device, you are expected to ask the user to provide the email. This is well documented for security reasons. Please read the documentation:
https://firebase.google.com/docs/auth/web/email-link-auth#security_concerns
If they start on a mobile device and expect to end on a mobile device, you can persist the email using
SharedPreferences
in Android orNSUserDefaults
in iOS, etc.ootpapps commentedon Jun 20, 2018
bojeil-google commentedon Jun 20, 2018
Hey @ootpapps, your questions are better suited for stackoverflow. The GitHub repo is not the right place for a tutorial.
For mobile flows, the
emailLink
is the FDL deep link (you can use FDL client libraries to help retrieve it, or just get it yourself using native APIs, the mobile documentation covers it) and the email is either previously saved if the flow started on that device or you ask the user for it.I don't understand what is confusing you. If the email link is redeemed in a web flow, then the user is signed in in the web page even if the user started from a mobile app. The opposite is true, if the user starts from a web site and opens the link on a mobile device with the app installed, the user completes sign in in the mobile app. The web page remains not signed in.
The summary is that the user will get signed in once in the mobile app or webpage that processed the link, where
signInWithEmailLink
is called and not necessarily where the flow was initiated.ootpapps commentedon Jun 20, 2018
jjalonso commentedon May 20, 2019
I think Im having same issue, and im asking here instead of stack overflow because is not about help is about decide or clarify the doc.
Imagine I have a normal website, (There is no phone app).
4) There is no way to get signed in state on desktop
Am I wrong? in case that i am right, I think this should be on the doc, I think I lost 1 week of development because I thought my desk could get signed in too.