1 ./script/generate oauth_provider 
 
   3 This creates an OAuth Provider controller as well as the requisite models.
 
   5 It requires an authentication framework such as acts_as_authenticated, restful_authentication or restful_open_id_authentication.
 
   7 If you generated the migration file (true by default), make sure you run
 
  10 You need to add the following routes to your config/routes.rb file:
 
  12 map.resources :oauth_clients
 
  13 map.oauth '/oauth',:controller=>'oauth',:action=>'index'
 
  14 map.authorize '/oauth/authorize',:controller=>'oauth',:action=>'authorize'
 
  15 map.request_token '/oauth/request_token',:controller=>'oauth',:action=>'request_token'
 
  16 map.access_token '/oauth/access_token',:controller=>'oauth',:action=>'access_token'
 
  17 map.test_request '/oauth/test_request',:controller=>'oauth',:action=>'test_request'
 
  19 include the following in your user.rb
 
  21 has_many :client_applications
 
  22 has_many :tokens, :class_name=>"OauthToken",:order=>"authorized_at desc",:include=>[:client_application]