Skip to content

Add email and random number authentication #2100

Description

@ChrisCRCB

Hi,
I'm creating a project at work using Serverpod, and I don't want users to have to remember yet another password. I plan to have them enter their email, then the server will email them a random 6-digit passcode which they can put into the server. Rather like the current implementation, but without the password, and with the added benefit of logging them out if they've not made a request in a certain amount of time.

Firstly, I ain't a security expert. I just know how fragile passwords are. Is this a terrible idea? My bank do it, so I'm thinking not, but I'd rather get a second opinion from you lovely people.

Secondly, if I make this, is it a feature that the team would consider adding back into Serverpod?

Thanks for a wonderful package. I look forward to any replies.

Activity

  1. SandPod commented on Apr 10, 2024

    @SandPod
    Contributor

    Hey @ChrisCRCB!

    This sounds very much like Slacks magic link and is basically just a multi factor authentication where possession of the email is the means of authenticating the user.

    I'm not a security expert either, so the advice given below only reflects my personal thoughts and are not best practices.

    There are a couple of things I would take into consideration:

    1. Email service security - The schema would rely on the security of the email service, this should be the same as if a user request a password reset but is good to keep in mind (which is basically what your 6-digit passcode would represent).
    2. Brute force concerns - Make sure there are mechanisms to protect from brute force attacks. This could be limiting the number of tries agains a validation code before it is removed together with a short time window for when the code works.

    This sounds like a neat feature to provide and would be cool to include. But for it to be included in the auth modules in Serverpod it would need to be a good implementation that is well tested and documented.

  2. added
    enhancement
    on Apr 10, 2024
  3. added
    area: authentication
    on Jan 3, 2025
  4. migalv commented on May 3, 2025

    @migalv

    I think this is quite important for modern applications.

    The sign-up and sign-in flows in applications have the highest churn percentage.

    It's key to have a easy & seamless authentication process and magic links are great to achieve this.

  5. moved this from Backlog 🗂️ to Done 🚀 in Serverpod Frameworkson Oct 22, 2026
  6. ChrisCRCB commented on Oct 22, 2026

    @ChrisCRCB
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: authenticationenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions