Jonathan Clark
Jonathan Clark

Reputation: 20548

Rails 3. Building an oauth2 provider

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?

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.

Thankful for all help!!

Upvotes: 42

Views: 29759

Answers (7)

Andrea Reginato
Andrea Reginato

Reputation: 1338

I've opensourced an OAuth2 server implementation yesterday.

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.

Upvotes: 25

d0minikk
d0minikk

Reputation: 49

"Doorkeeper is a gem that makes it easy to introduce OAuth 2 provider functionality to your application."

https://github.com/applicake/doorkeeper

Upvotes: 2

paulomuggler
paulomuggler

Reputation: 119

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!

Upvotes: 2

Felipe Philipp
Felipe Philipp

Reputation: 436

Check out this gem https://github.com/applicake/doorkeeper

It is for Rails 3, the development it's early stages though.

There's also an example app that you take a look and see how the API is done.

http://doorkeeper-provider.herokuapp.com/

Upvotes: 31

kiwnix
kiwnix

Reputation: 126

If you are using (or planning to use) devise for authentication, you can use https://github.com/socialcast/devise_oauth2_providable as plugin.

Upvotes: 9

nov matake
nov matake

Reputation: 958

I'm developing a rugygem for OAuth2 provider, Rack::OAuth2. 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

Upvotes: 5

raid5ive
raid5ive

Reputation: 6642

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:

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.

Upvotes: 24

Related Questions