Adding initial version of the OAuth token authentication method. This adds basic OAuth support for registering apps, getting and revoking keys, etc... The tokens come with 6 separate permissions bits; read/write user preferences, write diaries, write API and read/write GPS traces. Needs more tests.
This commit is contained in:
parent
2ad330d642
commit
b8f6dbd403
85 changed files with 3277 additions and 9 deletions
24
vendor/plugins/oauth-plugin/generators/oauth_provider/USAGE
vendored
Normal file
24
vendor/plugins/oauth-plugin/generators/oauth_provider/USAGE
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
./script/generate oauth_provider
|
||||
|
||||
This creates an OAuth Provider controller as well as the requisite models.
|
||||
|
||||
It requires an authentication framework such as acts_as_authenticated, restful_authentication or restful_open_id_authentication.
|
||||
|
||||
If you generated the migration file (true by default), make sure you run
|
||||
rake db:migrate
|
||||
|
||||
You need to add the following routes to your config/routes.rb file:
|
||||
|
||||
map.resources :oauth_clients
|
||||
map.oauth '/oauth',:controller=>'oauth',:action=>'index'
|
||||
map.authorize '/oauth/authorize',:controller=>'oauth',:action=>'authorize'
|
||||
map.request_token '/oauth/request_token',:controller=>'oauth',:action=>'request_token'
|
||||
map.access_token '/oauth/access_token',:controller=>'oauth',:action=>'access_token'
|
||||
map.test_request '/oauth/test_request',:controller=>'oauth',:action=>'test_request'
|
||||
|
||||
include the following in your user.rb
|
||||
|
||||
has_many :client_applications
|
||||
has_many :tokens, :class_name=>"OauthToken",:order=>"authorized_at desc",:include=>[:client_application]
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue