README.rdoc in oauth-plugin-0.3.14 vs README.rdoc in oauth-plugin-0.4.0.pre1

- old
+ new

@@ -4,21 +4,25 @@ We support the revised OAuth 1.0a specs at: http://oauth.net/core/1.0a +As well as support for OAuth 2.0: + +http://tools.ietf.org/html/draft-ietf-oauth-v2-10 + and the OAuth site at: http://oauth.net For more about the changes made to OAuth1.0a please see Seth's Idiot's Guide to OAuth 1.0a. http://mojodna.net/2009/05/20/an-idiots-guide-to-oauth-10a.html == Requirements -You need to install the oauth gem (0.3.5) which is the core OAuth ruby library. It will NOT work on any previous version of the gem. +You need to install the oauth gem (0.4.1) which is the core OAuth ruby library. It will NOT work on any previous version of the gem. sudo gem install oauth == Installation @@ -33,20 +37,47 @@ Alternatively you can install it in vendors/plugin: script/plugin install git://github.com/pelle/oauth-plugin.git -The Generator currently creates code (in particular views) that only work in Rails 2. +The Generator currently creates code (in particular views) that only work in Rails 2 and 3. It should not be difficult to manually modify the code to work on Rails 1.2.x I think the only real issue is that the views have .html.erb extensions. So these could theoretically just be renamed to .rhtml. Please let me know if this works and I will see if I can make the generator conditionally create .rhtml for pre 2.0 versions of RAILS. -== OAuth Provider generator +== OAuth Provider generator (Rails 3) +This currently supports rspec, test_unit, haml, erb, active_record and mongoid: + + rails g oauth_provider + +This generates OAuth and OAuth client controllers as well as the required models. + +It requires an authentication framework such as acts_as_authenticated, restful_authentication or restful_open_id_authentication. It also requires Rails 2.0. + +=== Generator Options + +The generator supports the defaults you have created in your application.rb file. eg: + + config.generators do |g| + g.orm :mongoid + g.template_engine :haml + g.test_framework :rspec + end + +=== User Model + +Add the following lines to your user model: + + has_many :client_applications + has_many :tokens, :class_name=>"OauthToken",:order=>"authorized_at desc",:include=>[:client_application] + +== OAuth Provider generator (Rails 2) + While it isn't very flexible at the moment there is an oauth_provider generator which you can use like this: ./script/generate oauth_provider This generates OAuth and OAuth client controllers as well as the required models. @@ -253,22 +284,28 @@ == OAuth Consumer generator The oauth_consumer generator creates a controller to manage the authentication flow between your application and any number of external OAuth secured applications that you wish to connect to. -To run it simply run: +To run it in Rails 3 simply run: + + rails g oauth_consumer +In previous versions: + ./script/generate oauth_consumer This generates the OauthConsumerController as well as the ConsumerToken model. -=== Generator Options +=== Generator Options (Rails 2) By default the generator generates ERB templates. The generator can instead create HAML templates. To do this use the following options: ./script/generate oauth_consumer --haml +Rails 3 respects your application defaults, see the oauth provider generator section above for more info. + === Configuration All configuration of applications is done in config/initializers/oauth_consumers.rb @@ -313,11 +350,11 @@ eg. If you connect to Yahoo's FireEagle you would add the :fire_eagle entry to OAUTH_CREDENTIALS and a new FireEagleToken model class will be created on the fly. This allows you to add a has_one association in your user model: - has_one :fire_eagle,:class_name=>"FireEagleToken", :dependent=>:destroy + has_one :fire_eagle, :class_name=>"FireEagleToken", :dependent=>:destroy And you could do: @location=@user.fire_eagle.client.location @@ -357,12 +394,10 @@ rake db:migrate == More -The Google Code project is http://code.google.com/p/oauth-plugin/ - The Mailing List for all things OAuth in Ruby is: http://groups.google.com/group/oauth-ruby The Mailing list for everything else OAuth is: @@ -371,6 +406,6 @@ The OAuth Ruby Gem home page is http://oauth.rubyforge.org Please help documentation, patches and testing. -Copyright (c) 2007-2009 Pelle Braendgaard, released under the MIT license +Copyright (c) 2007-2010 Pelle Braendgaard and contributors, released under the MIT license \ No newline at end of file