I am developing an API in Ruby on Rails 3 and I would like to secure it with Oauth2. In other words, I need to create an Oauth provider. Is there a working gem for Rails 3 out there or perhaps a tutorial on the issue?
我正在Ruby on Rails 3中开发一个API,我想用Oauth2来保护它。换句话说,我需要创建一个Oauth提供者。Rails 3是否有可用的gem ?或者是否有关于这个问题的教程?
UPDATE
更新
I know Rails are REST based so I find it very strange that there are no tutorials on how to create a public API and secure it. Does anyone know of any good tutorials. Preferable with oAuth.
我知道Rails是基于REST的,所以我觉得很奇怪,没有关于如何创建公共API并保护它的教程。有人知道什么好教程吗?oAuth更可取。
Thankful for all help!!
感谢所有的帮助! !
7 个解决方案
#1
24
I've opensourced an OAuth2 server implementation yesterday.
我昨天已经开放了OAuth2服务器实现。
It's well documented and there is a dashboard to control accesses. Right now I'm searching for somebody who wants to build an engine starting from it, or something cool on top of rack. That's why it is open-source.
它有良好的文档记录,并且有一个指示板来控制访问。现在我正在寻找一个想要建立一个引擎的人,从它开始,或一些很酷的东西在机架上。这就是为什么它是开源的。
#2
31
Check out this gem https://github.com/applicake/doorkeeper
查看这个gem https://github.com/applicake/doorkeeper
It is for Rails 3, the development it's early stages though.
它是针对Rails 3的,开发它的早期阶段。
There's also an example app that you take a look and see how the API is done.
还有一个示例应用程序,您可以查看API是如何完成的。
http://doorkeeper-provider.herokuapp.com/
http://doorkeeper-provider.herokuapp.com/
#3
24
https://github.com/intridea/oauth2 is the canonical gem right now for OAuth2 dev. If you are looking for a more complete solution, instead of rolling your own provider code, check out:
https://github.com/dea薪/ OAuth2是OAuth2 dev的标准配置。
- https://github.com/songkick/oauth2-provider
- https://github.com/songkick/oauth2-provider
- https://github.com/freerange/oauth2-provider
- https://github.com/freerange/oauth2-provider
But I suggest messing around with the oauth2 gem if you aren't very familiar with the flow so that you can learn it better.
但是我建议你如果不太熟悉oauth2 gem,那就试试吧,这样你就能更好地理解它了。
#4
9
If you are using (or planning to use) devise for authentication, you can use https://github.com/socialcast/devise_oauth2_providable as plugin.
如果您正在使用(或计划使用)设计来进行身份验证,您可以使用https://github.com/socialcast/devise_oauth2_providable作为插件。
#5
5
I'm developing a rugygem for OAuth2 provider, Rack::OAuth2. https://github.com/nov/rack-oauth2
我正在为OAuth2供应商——Rack: OAuth2开发rugygem。https://github.com/nov/rack-oauth2
It requires to develop models (token, code, client etc) by yourself, but you can get a whole Rails3 sample OAuth2 server here. https://github.com/nov/rack-oauth2-sample
它需要您自己开发模型(令牌、代码、客户端等),但是您可以在这里得到一个完整的Rails3示例OAuth2服务器。https://github.com/nov/rack-oauth2-sample
#6
2
I'm looking to implement an OAuth2 provider, too! I'm currently experimenting with this https://github.com/assaf/rack-oauth2-server, which seems to be a full-featured OAuth2 server, though it still supports only MongoDB, although implementing support for other DBMS seems simple enough. I am also looking at some of the other options posted here, lots of promising stuff!
我也在寻找OAuth2提供者!我目前正在试验这个https://github.com/assaf/rack-oauth2-server,它似乎是一个功能完整的OAuth2服务器,虽然它仍然只支持MongoDB,但是对其他DBMS的支持似乎很简单。我也在看一些其他的选项,很多有前途的东西!
#7
2
"Doorkeeper is a gem that makes it easy to introduce OAuth 2 provider functionality to your application."
“看门人是一颗宝石,可以很容易地将OAuth 2提供者的功能介绍给你的应用程序。”
https://github.com/applicake/doorkeeper
https://github.com/applicake/doorkeeper
#1
24
I've opensourced an OAuth2 server implementation yesterday.
我昨天已经开放了OAuth2服务器实现。
It's well documented and there is a dashboard to control accesses. Right now I'm searching for somebody who wants to build an engine starting from it, or something cool on top of rack. That's why it is open-source.
它有良好的文档记录,并且有一个指示板来控制访问。现在我正在寻找一个想要建立一个引擎的人,从它开始,或一些很酷的东西在机架上。这就是为什么它是开源的。
#2
31
Check out this gem https://github.com/applicake/doorkeeper
查看这个gem https://github.com/applicake/doorkeeper
It is for Rails 3, the development it's early stages though.
它是针对Rails 3的,开发它的早期阶段。
There's also an example app that you take a look and see how the API is done.
还有一个示例应用程序,您可以查看API是如何完成的。
http://doorkeeper-provider.herokuapp.com/
http://doorkeeper-provider.herokuapp.com/
#3
24
https://github.com/intridea/oauth2 is the canonical gem right now for OAuth2 dev. If you are looking for a more complete solution, instead of rolling your own provider code, check out:
https://github.com/dea薪/ OAuth2是OAuth2 dev的标准配置。
- https://github.com/songkick/oauth2-provider
- https://github.com/songkick/oauth2-provider
- https://github.com/freerange/oauth2-provider
- https://github.com/freerange/oauth2-provider
But I suggest messing around with the oauth2 gem if you aren't very familiar with the flow so that you can learn it better.
但是我建议你如果不太熟悉oauth2 gem,那就试试吧,这样你就能更好地理解它了。
#4
9
If you are using (or planning to use) devise for authentication, you can use https://github.com/socialcast/devise_oauth2_providable as plugin.
如果您正在使用(或计划使用)设计来进行身份验证,您可以使用https://github.com/socialcast/devise_oauth2_providable作为插件。
#5
5
I'm developing a rugygem for OAuth2 provider, Rack::OAuth2. https://github.com/nov/rack-oauth2
我正在为OAuth2供应商——Rack: OAuth2开发rugygem。https://github.com/nov/rack-oauth2
It requires to develop models (token, code, client etc) by yourself, but you can get a whole Rails3 sample OAuth2 server here. https://github.com/nov/rack-oauth2-sample
它需要您自己开发模型(令牌、代码、客户端等),但是您可以在这里得到一个完整的Rails3示例OAuth2服务器。https://github.com/nov/rack-oauth2-sample
#6
2
I'm looking to implement an OAuth2 provider, too! I'm currently experimenting with this https://github.com/assaf/rack-oauth2-server, which seems to be a full-featured OAuth2 server, though it still supports only MongoDB, although implementing support for other DBMS seems simple enough. I am also looking at some of the other options posted here, lots of promising stuff!
我也在寻找OAuth2提供者!我目前正在试验这个https://github.com/assaf/rack-oauth2-server,它似乎是一个功能完整的OAuth2服务器,虽然它仍然只支持MongoDB,但是对其他DBMS的支持似乎很简单。我也在看一些其他的选项,很多有前途的东西!
#7
2
"Doorkeeper is a gem that makes it easy to introduce OAuth 2 provider functionality to your application."
“看门人是一颗宝石,可以很容易地将OAuth 2提供者的功能介绍给你的应用程序。”
https://github.com/applicake/doorkeeper
https://github.com/applicake/doorkeeper