RFC: Token providers #1465
Replies: 12 comments 13 replies
-
+1 for Magic support - it would be great to have a clean abstraction for handling integrations like that. I wrote a brief blog post here on how I am currently integrating Magic w/ NextAuth via a custom |
Beta Was this translation helpful? Give feedback.
-
What really confuses me is that for all I can tell But I guess we are trying to draw a distinction here between:
However, this excludes the Magic proposal, because with it the authorisation is done via a 3rd party - this seems much more of a simple credentials case? But as for scope:
Anything missing, or incorrect? |
Beta Was this translation helpful? Give feedback.
-
Minor consideration: 6 digit codes can go stale on the DB.Another thing to consider. Currently (with The issue with this is that an adapter's The user can still generate a new token to overcome this, so at least they are not stuck forever. Probably the best solution here is to instruct adapter authors to remove any expired tokens at the beginning of |
Beta Was this translation helpful? Give feedback.
-
How do we deal with multiple UIs?Currently, the UI for There are going to be some difference between SMS (country, phone number) and Email. How do we handle this? Options:
|
Beta Was this translation helpful? Give feedback.
-
Some thought on @armandabric proposal:
Where else this context will be used? Currently there is I guess the generic
You could just provide
Agree. Although
|
Beta Was this translation helpful? Give feedback.
-
Any updates on this? I'm looking to use NextAuth with a custom backend (Node.js server) to handle SMS authentication. Currently, I'm exploring a workaround using either the email and credentials provider, but my requirements are being able to send a 6-digit code via SMS and I would prefer to not create a separate database connection from the Next app. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi, Same request here. We have a NextJS app where users need to authenticate on a REST API, through SMS OTP. The authentication flow consists on 2 steps (2 requests) :
On the UI, same flow :
Right now, doing that with NextAuth and a |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm not sure if this is the right place to comment but I'm trying to figure out how to send a magic link email so an authenticated user can invite a new team member. It woudl be great to have some documentation about how to break into this flow from the backend, or some other way. |
Beta Was this translation helpful? Give feedback.
-
Any updates on the RFC? |
Beta Was this translation helpful? Give feedback.
-
Would be great to have that :) |
Beta Was this translation helpful? Give feedback.
-
While this PR from @ThangHuuVu does allow the flexibility to send a verification link via SMS (or other method) in addition to email, I'm wondering if this provider should more accurately be named Perhaps all of this functionality could/should be built into a single provider, but it feels like there is a logical separation in intended flow for end users. I'd love to hear other's thoughts on this before spending any time on implementing. cc @balazsorban44 |
Beta Was this translation helpful? Give feedback.
-
email sign in is amazing in theory but unfortunately in reality it's not. Because in many mobile email apps, they open the link in web view....which is super temporary and not the browser that user initiated.. It's very frustrating because there is nothing you can do about it. So solution like OTP could be more practical solution. |
Beta Was this translation helpful? Give feedback.
-
Goals:
type: "token"
one under the hood. So this CAN be implemented in a backward-compatible way.Background:
We are pushing against rolling your own email+password database solutions (although it can easily be implemented with the Credentials provider), as they are less secure since it is easier to introduce security holes without the proper knowledge.
There are many advantages with passwordless methods. In case of the existing Email provider, the security concerns* are moved from your app to your e-mail provider, who usually have a much more robust infrastructure in place for all kinds of threat mitigation already.
Now there are ways of doing paswordless logins, than our current solution. For e-mail for starters, we require you to bring your own mail server, which might not be straight forward in some situations.
With the help of this RFC, we could create an abstraction that would make it easy to integrate against solutions like Magic, or SMS (anything else? Please add it in the comments)
Implementation:
The implementation details are not fully clear yet, but we could probably build on the Email provider, also could look for inspiration in this now closed PR #409 that attempted to add webhook support.
Out of scope:
Open PR:
Beta Was this translation helpful? Give feedback.
All reactions