[英]Firebase Authentication via “Magic-Link”
I want to send notification mails to users of my community platform coded with react and firebase.我想向使用 react 和 firebase 编码的社区平台的用户发送通知邮件。 I was wondering is there is a way to authenticate the user via a magic link which is contained in his or her personal notification mails.
我想知道是否有一种方法可以通过包含在他或她的个人通知邮件中的魔术链接对用户进行身份验证。
Eg You've got 5 new comments on your post click HERE to read them例如,您的帖子有 5 条新评论,请点击此处阅读
Clicking "here" should redirect the user to the page and automatically authenticate him without having to enter their individual passwords or usernames.单击“此处”应将用户重定向到该页面并自动对其进行身份验证,而无需输入他们的个人密码或用户名。
Due to the cancelation of the privacy shield framework and Schrems II , you might no longer be able to store customer details in the GCP.由于隐私保护框架和Schrems II的取消,您可能无法再在 GCP 中存储客户详细信息。
A solution for it can be pseudonymization .它的解决方案可以是假名。
I am running an open-source project that can help you with that.我正在运行一个开源项目,可以帮助您解决这个问题。
Check out the following article for more information:查看以下文章了解更多信息:
https://databunker.org/use-case/schrems-ii-compliance/ https://databunker.org/use-case/schrems-ii-compliance/
I think your question can be divided into 2 different questions.我认为您的问题可以分为两个不同的问题。
I have never used notification mails in Firebase, I usually use google's SMTP server directly and send a request to the server to send an email on behalf of me.我从来没有在 Firebase 中使用过通知邮件,我通常直接使用 google 的 SMTP 服务器并向服务器发送请求以代表我发送电子邮件。 So, in your case, I would search up the library on your tech stack (for me it was Go's gomail ), then you can use Google's SMTP server (host:smtp.gmail.com, port:587).
所以,在你的情况下,我会在你的技术栈上搜索库(对我来说是 Go 的gomail ),然后你可以使用谷歌的 SMTP 服务器(主机:smtp.gmail.com,端口:587)。
I feel like this is the harder question.我觉得这是一个更难的问题。 I think you need to consider a few things:
我认为您需要考虑以下几点:
I'm pretty much against sending time sensitive notification like that through emails.我非常反对通过电子邮件发送这样的时间敏感通知。 But if it is something that you still want to do, it is pretty easy to create the link, the simplest way I did it was:
但是,如果您仍然想做某事,那么创建链接非常容易,我做的最简单的方法是:
/magic/:link_id
that takes link_id
then checks what user should be logged in./magic/:link_id
接受link_id
然后检查应该登录的用户。 Finally, you can send the link through email like the first part of the problem!最后,您可以像问题的第一部分一样通过电子邮件发送链接!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.