对于导轨小白的身份验证策略 [英] Rails authentication strategy for noob

查看:142
本文介绍了对于导轨小白的身份验证策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望这不是太广泛,但很多谷歌上搜索后,我不知道从哪里开始。我要寻找一个入门/小白介绍,帮助我开始构建一个认证实现了轨3应用程序。

Hope this is not too broad but after a lot of googling I am not sure where to start. I am looking for a introductory/noob overview to help me get started on building an authentication implementation for a rails 3 application.

基本技术要求:


  • 的Rails 3应用程序托管在第三方服务(Heroku的)

  • 需要使用特定的外部私人SSO服务验证用户身份。

  • 在Rails应用程序没有本地用户数据库或模式。

  • 认证是基于令牌的意思,有需要被读取令牌传递回SSO服务器(而不是基于轨)的特殊的cookie。

  • 我有超过SSO服务器或基础设施的控制。

  • SSO服务器的信任是隐含的,不希望维护用户,密码,或敏感信息的本地数据库。用户信息只有会话期间存在与SSO服务器是权威的。

  • 会话令牌的信息是基于Cookie和生活的浏览器会话的持续时间。

我要寻找基本的例子/教程/策略/如何进程将在轨工作,与上面的设置说明。我想这个过程是无缝的与用户的工作流程,基本上是这样的:

I am looking for basic example/tutorial/strategy/explanation of how the process would work in rails with the above setup. I would like the process to be seamless for user with workflow that basically looks like this:


  • 导航到Rails应用程序 - >

  • 重定向未授权的用户SSO服务器 - >

  • 登录和通过远程SSO服务器进行身份验证 - >

  • 的回调/重定向到Rails应用程序 - >

  • 捕捉用户信息在Rails应用程序通过从SSO服务器背部和负载受保护资源

策略是完全自定义的使用私有SSO资源,不使用以及公布的权威性机制(换句话说没有Facebook,谷歌,Twitter的,OAuth的,等等)。

Strategy is completely custom using a private SSO resource and does not use a well published auth mechanism (in other words not Facebook, Google, Twitter, OAuth, etc).

这是术语任何帮助的,连贯的教程,例子是AP preciated。

Any help on terminology, coherent tutorials, examples would be appreciated.

修改/更新:

要更具体,我也在寻找好的文档如何创建自定义的omniauth开发战略。一些教程,通过那种说话任意SSO服务器所需code的推移,读出令牌的cookie,并完成验证握手和回调/重定向。

To be more specific I am also looking for good documentation how to create an omniauth custom developer strategy. Some tutorial that goes through the kind of code required to talk to an arbitrary SSO server, read a token out of a cookie, and complete the authentication handshake and callback/redirect.

推荐答案

这是不是一个真正的答案,但我张贴这一点,因为评论只是不会做。我不知道任何COM prehensive导游所以这里的就是我建议你做的:

This isn't really an answer but I'm posting this because a comment just wouldn't do. I don't know of any comprehensive guides so here's what I'd suggest you do:


  1. 了解Omniauth是如何工作的。有使用Twitter有很大 Railscast了解认证。这真的很简单,将让你在事物的流量。

  1. Learn how Omniauth works. There's a great Railscast about authentication using Twitter. It's really simple and it will get you in the flow of the thing.

构建自己的Omniauth策略。去的 Omniauth策略列表,滚动至开发策略。在该表中,选择您可以用它来连接到您的SSO服务器战略。

Build your own Omniauth strategy. Go to the list of Omniauth Strategies and scroll to Developer Strategies. In that table, choose the strategy you can use to connect to your SSO server.

在理想情况下,你可以使用的OAuth2,有一对夫妇的谈实现自己的OAuth战略指南:

Ideally, you'd be able to use OAuth2 and there are a couple of guides that talk about implementing your own OAuth strategy:


  1. 定制的OAuth 1.0战略,以连接到RDIO

  2. 定制的OAuth 2.0战略,Intridea(Omniauth的创造者)

  3. 定制的OAuth 2.0战略,Heroku的连接到Force.com

  1. Custom OAuth 1.0 strategy to connect to Rdio
  2. Custom OAuth 2.0 strategy by Intridea (the creators of Omniauth)
  3. Custom OAuth 2.0 strategy to connect to Force.com by Heroku

但既然你不能,只要给一个快速看看那些指南。没有它是一种很难(对我来说),任何细节给予更多的帮助,但希望别人会填写详细信息。

But since you can't, just give a quick look at those guides. Without any specifics it's kind of hard (for me) to give any more help, but hopefully someone else will fill in the details.

这篇关于对于导轨小白的身份验证策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆