EDIT: It has been pointed out that slack already does essentially this, which gives me hope.
I’m no security expert, and it’s probably about to show.
I’ve had an idea for a simple passwordless auth system bouncing around in my head. I’ve seen similar ideas floated once or twice before but don’t see it used anywhere, so I’m assuming it’s not as good of an idea as I think it is. The idea is essentially to use a password reset flow for all logins, not just when you need to reset your password. So it goes something like this:
User prompted for and inputs email address
Server sends them an email with a randomly generated key. The key expires in a short period (5-10 minutes) or after first use, whichever is sooner.
User inputs key (possibly automatically by clicking a link in the email).
Server verifies the key, generates a random token, and sets it in a cookie/local storage which is valid for a reasonable session period (a day or two, maybe a week).
Advantages:
* Very simple to implement. Few moving pieces.
* Authorization can be handled by associating resources with lists of authorized email addresses, so technically users don't need an "account" in order to "login" and access the resources.
* User doesn’t have to remember a password. If you can prove you control the email address, you’re authenticated.
* No passwords to hack/phish from the database.
Disadvantages:
* If someone gets control of your email address, they have complete control over any service relying on this system. However, I don’t see this as different from password reset flows which rely on email (ie Slack’s magic links).
* User has to open their email every time they login.
* You tell me.
I hate it, however. Quoting from another HN comment of mine:
It's _not_ convenient in many cases, such as if you're using an incognito/private window, or on a friend's computer, school PCs, don't have access to email, etc.
I much prefer the traditional username+password system. You shouldn't be memorising passwords anyway, use a password manager.
Your system doesn't allow password managers to work. Password managers are quicker than clicking on links in emails, and if you're on a stranger's PC that doesn't have the browser extension, you can just look the password up in the phone app and type it in.