Skip to content

FR: Authentication with only email (no password) #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mesqueeb opened this issue Dec 11, 2017 · 18 comments
Closed

FR: Authentication with only email (no password) #365

mesqueeb opened this issue Dec 11, 2017 · 18 comments

Comments

@mesqueeb
Copy link

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

@mono0926
Copy link

Now supported 🎉

https://firebase.google.com/support/release-notes/js#4.12.0

Added several APIs to support the new passwordless email sign in feature.

https://firebase.google.com/support/release-notes/ios#4.11.0

Adds new API to allow authentication using only an email link (Passwordless Authentication with email link).

@mesqueeb
Copy link
Author

Thank you very much!

@forgr-owner
Copy link

@bojeil-google @mono0926 could we configure/customize the template who is send to the user ?

@bojeil-google
Copy link
Contributor

Currently this is not possible to prevent abuse.

@ootpapps
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

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
Copy link

ootpapps commented Jun 15, 2018 via email

@bojeil-google
Copy link
Contributor

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:

if (firebase.auth().isSignInWithEmailLink(window.location.href) {
  // Get email...
  // ...
  // sign in.
  firebase.auth().signInWithEmailLink(email, window.location.href)
}

@ootpapps
Copy link

ootpapps commented Jun 15, 2018 via email

@ootpapps
Copy link

ootpapps commented Jun 19, 2018 via email

@bojeil-google
Copy link
Contributor

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 or NSUserDefaults in iOS, etc.

@ootpapps
Copy link

ootpapps commented Jun 20, 2018 via email

@bojeil-google
Copy link
Contributor

bojeil-google commented 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
Copy link

ootpapps commented Jun 20, 2018 via email

@jjalonso
Copy link

jjalonso commented 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).

  1. I start on my desktop and entered my email addr
  2. Take the phone and click on the phone link
  3. Phone will be signed in after confirm email
    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.

@firebase firebase locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants