sorcery 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sorcery might be problematic. Click here for more details.
- data/README.rdoc +44 -6
- data/VERSION +1 -1
- data/lib/generators/sorcery_migration/templates/{oauth.rb → external.rb} +1 -1
- data/lib/sorcery/controller/submodules/email.rb +44 -0
- data/lib/sorcery/controller/submodules/external/protocols/oauth1.rb +35 -0
- data/lib/sorcery/controller/submodules/external/protocols/oauth2.rb +26 -0
- data/lib/sorcery/controller/submodules/{oauth → external}/providers/facebook.rb +24 -6
- data/lib/sorcery/controller/submodules/{oauth → external}/providers/twitter.rb +31 -6
- data/lib/sorcery/controller/submodules/external.rb +83 -0
- data/lib/sorcery/controller.rb +5 -3
- data/lib/sorcery/model/submodules/{oauth.rb → external.rb} +3 -3
- data/lib/sorcery/model.rb +9 -6
- data/lib/sorcery.rb +9 -7
- data/sorcery.gemspec +14 -12
- data/spec/Gemfile +1 -1
- data/spec/Gemfile.lock +2 -2
- data/spec/rails3/app_root/Gemfile +1 -1
- data/spec/rails3/app_root/Gemfile.lock +2 -2
- data/spec/rails3/app_root/app/controllers/application_controller.rb +11 -11
- data/spec/rails3/app_root/db/migrate/{oauth → external}/20101224223628_create_authentications.rb +0 -0
- data/spec/rails3/app_root/spec/controller_oauth2_spec.rb +13 -13
- data/spec/rails3/app_root/spec/controller_oauth_spec.rb +12 -12
- data/spec/rails3/app_root/spec/user_oauth_spec.rb +4 -4
- data/spec/rails3/app_root/spec/user_spec.rb +2 -2
- data/spec/sinatra/Gemfile +1 -1
- data/spec/sinatra/Gemfile.lock +2 -2
- data/spec/sinatra/db/migrate/{oauth → external}/20101224223628_create_authentications.rb +0 -0
- data/spec/sinatra/myapp.rb +11 -11
- data/spec/sinatra/spec/controller_oauth2_spec.rb +13 -13
- data/spec/sinatra/spec/controller_oauth_spec.rb +12 -12
- data/spec/sinatra/spec/user_oauth_spec.rb +4 -4
- data/spec/sinatra/spec/user_spec.rb +2 -2
- metadata +14 -12
- data/lib/sorcery/controller/submodules/oauth/oauth1.rb +0 -33
- data/lib/sorcery/controller/submodules/oauth/oauth2.rb +0 -24
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'oauth2'
|
2
|
-
module Sorcery
|
3
|
-
module Controller
|
4
|
-
module Submodules
|
5
|
-
module Oauth
|
6
|
-
module Oauth2
|
7
|
-
def oauth_version
|
8
|
-
"2.0"
|
9
|
-
end
|
10
|
-
|
11
|
-
def authorize_url(*args)
|
12
|
-
client = ::OAuth2::Client.new(@key, @secret, :site => @site)
|
13
|
-
client.web_server.authorize_url(:redirect_uri => @callback_url, :scope => @scope)
|
14
|
-
end
|
15
|
-
|
16
|
-
def get_access_token(args)
|
17
|
-
client = ::OAuth2::Client.new(@key, @secret, :site => @site)
|
18
|
-
client.web_server.get_access_token(args[:code], :redirect_uri => @callback_url)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|