songkick / oauth2-provider

Simple OAuth 2.0 provider toolkit
MIT License
528 stars 148 forks source link

Example for Rails #41

Closed greggersh closed 12 years ago

greggersh commented 12 years ago

It would be useful to see an example using this gem with Rails 3.2. Does such a thing exist?

swishstache commented 12 years ago

I wouldn't think anything would be different beyond what's already in the read me: require or specify in gem file, set the realm in an initializer, create a migration, rake db:migrate, get the mixin in your owner and client models, and code the OAuth request endpoints in your controller(s).

How far have you gotten with the setup?

jcoglan commented 12 years ago

I don't know of one, but it's basically the same as the Sinatra example here. Just replace Sinatra routing/rendering APIs with Rails equivalents. The library can process Rails request objects just fine.