[英]Integrating Auth0 into a Node & Express app
I'm using Node and Express for the backend of a mobile app (Flutter).我将 Node 和 Express 用于移动应用程序 (Flutter) 的后端。
I'd like all authentication REST facing the client to be auth0's, since they can handle attacks and security in general much better than me.我希望面向客户端的所有身份验证 REST 都是 auth0 的,因为它们通常可以比我更好地处理攻击和安全性。
Sign Up -报名 -
Sign In - Same as Sign Up basically, except there's no need to accept custom fields from the client.登录 - 基本上与注册相同,除了不需要接受来自客户端的自定义字段。
If such a flow is possible, can you please refer me to the relevant docs or otherwise help me understand how?如果这样的流程是可能的,您能否请我参考相关文档或以其他方式帮助我了解如何? Example implementations in node/express would be much appreciated as well.
node/express 中的示例实现也将不胜感激。
As christian mentioned in the comments, you can use a post reg web hook.正如评论中提到的克里斯蒂安,您可以使用帖子 reg web 挂钩。 In addition, because hooks do not support social connections, you can use a rule to send a request to your server to create the user in your db.
此外,由于钩子不支持社交连接,您可以使用规则向您的服务器发送请求以在您的数据库中创建用户。 You can add a flag to the user's metadata to determine whether or not this rule runs.
您可以向用户的元数据添加一个标志以确定此规则是否运行。
https://auth0.com/docs/hooks/concepts/post-user-registration-extensibility-point https://auth0.com/docs/hooks/concepts/post-user-registration-extensibility-point
Here is another strategy: https://community.auth0.com/t/distinguish-between-first-login-and-silent-auth/32986这是另一种策略: https://community.auth0.com/t/distinguish-between-first-login-and-silent-auth/32986
Let me know if this makes sense.让我知道这是否有意义。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.