使用电子邮件验证进行用户注册,并在 Ruby 中进行身份验证
我正在尝试在 Sinatra 中制作一个网络应用程序,我想知道是否有一个好的解决方案用于通过电子邮件验证以及身份验证进行用户注册 - 也许作为机架中间件? 如果有 OpenID 支持就好了。
我想我可以自己动手,但我不想重新发明轮子。 如果我必须这样做,任何人都可以向我指出我可能想要使用的库,甚至是示例代码吗? 我还担心我最终可能会忘记实施一些重要的注册/身份验证功能,因为我以前从未这样做过。
如果我需要自制解决方案,我找到了用于密码加密的 bcrypt-ruby 和 Sinatra::Mailer 或 Pony 发送电子邮件。 要使用 OpenID 支持进行登录,可以使用 hancock 和 hancock-client,虽然我不太清楚用法,而且我实际上并不需要 单点登录支持。 也许我应该使用 ruby openid 库? 我还需要什么吗?
这是一个相当混乱的问题,但我希望更有经验的人可以指出我正确的方向。
I'm trying to make a web app in Sinatra, and I was wondering if there was a good solution for user sign-up with email verification, as well as authentication - perhaps as rack middleware? OpenID support would be nice to have too.
I suppose I can roll my own, but I didn't want to reinvent the wheel. If I have to do so, can anyone point me to the libraries I might want to use, maybe even example code? I'm also worried I might end up forgetting to implement something important with signup/authentication, since I've never done this before.
In case I need a homemade solution, I've found bcrypt-ruby for password encryption and Sinatra::Mailer or Pony for email. For signing on with OpenID support, there's hancock and hancock-client, though I'm not entirely clear on usage and I don't actually need single sign-on support. Maybe I should just use a ruby openid library? Do I need anything else?
This is a pretty muddled question, but I hope someone more experienced can point me in the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能对 Authlogic 感兴趣。 您需要自己实现电子邮件验证,但这将为您提供支持这一点的良好基础。
You might be interested in Authlogic. You'll need to implement the e-mail verification yourself, but it will provide you with a good foundation for supporting this.