Replies: 6 comments 4 replies
-
This would be the concern of the application developer, not Pevensie.
We can potentially provide both options, though I would be inclined to go for the first option by default. Supabase do this well.
UUIDv7 would be preferable, I think.
This is not a Pevensie concern - we would provide functions for email signin or username signin, and the application developer could write this logic. That said, we might not want username signin as an option, as it's trivial to implement on top of email. Imo we should start with email+password auth, as it's the simplest. We can integrate it well with the email package when we create it later. |
Beta Was this translation helpful? Give feedback.
-
Partly in response to Nicd in Discord with regards to SMS' relative insecurity for MFA: I mentioned sending MFA codes via email / SMS because it does provide some degree of additional security while having a fairly decent UX. Especially if we're starting with email-based authentication, then an application can potentially default to email-based MFA (this is quite common, in my experience). Both email and SMS based MFA are less secure than OTP, which we should also support in time, but that may be worth a separate discussion. |
Beta Was this translation helpful? Give feedback.
-
https://lucia-auth.com/ is the best auth library I've seen in any language. Worth having a look for some inspiration. |
Beta Was this translation helpful? Give feedback.
-
A con for SMS: it's not exclusively usable in a B2B context due to employees not all having company phone numbers. |
Beta Was this translation helpful? Give feedback.
-
Oidc on 0auth with it setup so adding in the biggest providers is easy then an email option that sends a code to users email rather than a password for the people that don't like using sign in as google. |
Beta Was this translation helpful? Give feedback.
-
Passkey support would be amazing to have as well! |
Beta Was this translation helpful? Give feedback.
-
There are many ways to attempt to uniquely identify a user for them to log into
a system, all(?) of which flawed in some way.
This thread is for discussing the scope of what we would initially want to
support for user login, and perhaps the scope of what we might want to
eventually support.
Forms of login ID
Below are forms of identification, with their strengths, weaknesses, and other
considerations. Most of this is common knowledge, but just to lay it out:
Username
Pros:
Cons:
Other:
front of" email or phone
Email
Pros:
Cons:
meaning they aren't especially reliable in terms of preventing spam accounts
and the like, unless we present the option to limit sign-ins to major
providers
Other:
account
Phone / SMS
Pros:
Cons:
emails
Other:
account
Social Login
Pros:
Cons:
Other:
logins. If I have
me@gmail.com
signed in via email+password, and then decideto login in via OAuth, what happens?
distinguishing it?
Canonical ID
I think we should use UUID v4s for canonical user IDs, making usernames, emails,
and perhaps phone numbers optional fields, where the application author can
determine which is the default / primary means of identifying a user. All
user-associated records would of course be linked with the canonical UUID, so
the application author would be able to have a more "open" system if they so
choose. This allows for perhaps the changing of associated username / email /
phone number without affecting very much apart from the user's login means.
The database performance concerns of random UUIDs aren't worth worrying about
until you get to a very large number of user accounts, from what I can tell.
Initial Scope
A basic yet flexible start would be to target scenarios such as:
@
try email lookup, else try username lookup)Username here, if available, would be the display name of the account. MFA codes
can be sent via email, if enabled for the account and email sending configured
for the application.
Eventual Scope
I consider social logins to be highly desirable, but this would require more
R&D. We'd need separate modules per provider, most likely, and likely some form
of additional distinguishing detail in the model / schema.
I would consider SMS-based login IDs to be low priority, and SMS-based account
verification to be slightly higher priority, but lower than social logins.
Beta Was this translation helpful? Give feedback.
All reactions