multiauth 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,8 +1,5 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
3
  gem 'rails', '>=3.0.0'
4
- gem 'devise', :git => 'http://github.com/plataformatec/devise.git'
5
- gem 'devise_openid_authenticatable', :git => "http://github.com/nbudin/devise_openid_authenticatable.git"
6
- gem 'devise-twitter', '0.1.1'
7
- gem 'oauth2', '0.0.13'
4
+ gem 'omniauth', "0.1.1"
8
5
 
data/Gemfile.lock CHANGED
@@ -1,19 +1,3 @@
1
- GIT
2
- remote: http://github.com/nbudin/devise_openid_authenticatable.git
3
- revision: b827771918439cc9a82cdd7e68d5e3c7da898f8a
4
- specs:
5
- devise_openid_authenticatable (1.0.0.alpha7)
6
- devise (>= 1.0.6)
7
- rack-openid (>= 1.2.0)
8
-
9
- GIT
10
- remote: http://github.com/plataformatec/devise.git
11
- revision: ef3480004c8511d09c0047b8406dd3cf7f828e01
12
- specs:
13
- devise (1.2.rc)
14
- bcrypt-ruby (~> 2.1.2)
15
- warden (~> 1.0.0)
16
-
17
1
  GEM
18
2
  remote: http://rubygems.org/
19
3
  specs:
@@ -47,11 +31,7 @@ GEM
47
31
  addressable (2.2.1)
48
32
  arel (1.0.1)
49
33
  activesupport (~> 3.0.0)
50
- bcrypt-ruby (2.1.2)
51
34
  builder (2.1.2)
52
- devise-twitter (0.1.1)
53
- devise (>= 1.1.0)
54
- warden_oauth (~> 0.1.1)
55
35
  erubis (2.6.6)
56
36
  abstract (>= 1.0.0)
57
37
  faraday (0.4.6)
@@ -64,17 +44,47 @@ GEM
64
44
  treetop (>= 1.4.5)
65
45
  mime-types (1.16)
66
46
  multi_json (0.0.4)
47
+ net-ldap (0.1.1)
48
+ nokogiri (1.4.3.1)
49
+ oa-basic (0.1.1)
50
+ multi_json (~> 0.0.2)
51
+ nokogiri (~> 1.4.2)
52
+ oa-core (= 0.1.1)
53
+ rest-client (~> 1.6.0)
54
+ oa-core (0.1.1)
55
+ rack (~> 1.1)
56
+ oa-enterprise (0.1.1)
57
+ net-ldap (~> 0.1.1)
58
+ nokogiri (~> 1.4.2)
59
+ oa-core (= 0.1.1)
60
+ rubyntlm (~> 0.1.1)
61
+ oa-oauth (0.1.1)
62
+ multi_json (~> 0.0.2)
63
+ nokogiri (~> 1.4.2)
64
+ oa-core (= 0.1.1)
65
+ oauth (~> 0.4.0)
66
+ oauth2 (~> 0.0.10)
67
+ oa-openid (0.1.1)
68
+ oa-core (= 0.1.1)
69
+ rack-openid (~> 1.1.1)
70
+ ruby-openid-apps-discovery
67
71
  oauth (0.4.3)
68
72
  oauth2 (0.0.13)
69
73
  faraday (~> 0.4.1)
70
74
  multi_json (>= 0.0.4)
75
+ omniauth (0.1.1)
76
+ oa-basic (= 0.1.1)
77
+ oa-core (= 0.1.1)
78
+ oa-enterprise (= 0.1.1)
79
+ oa-oauth (= 0.1.1)
80
+ oa-openid (= 0.1.1)
71
81
  polyglot (0.3.1)
72
82
  rack (1.2.1)
73
83
  rack-mount (0.6.13)
74
84
  rack (>= 1.0.0)
75
- rack-openid (1.2.0)
76
- rack (>= 1.1.0)
77
- ruby-openid (>= 2.1.8)
85
+ rack-openid (1.1.2)
86
+ rack (>= 0.4)
87
+ ruby-openid (>= 2.0.3)
78
88
  rack-test (0.5.6)
79
89
  rack (>= 1.0)
80
90
  rails (3.0.0)
@@ -91,23 +101,20 @@ GEM
91
101
  rake (>= 0.8.4)
92
102
  thor (~> 0.14.0)
93
103
  rake (0.8.7)
104
+ rest-client (1.6.1)
105
+ mime-types (>= 1.16)
94
106
  ruby-openid (2.1.8)
95
- thor (0.14.2)
107
+ ruby-openid-apps-discovery (1.2.0)
108
+ ruby-openid (>= 2.1.7)
109
+ rubyntlm (0.1.1)
110
+ thor (0.14.3)
96
111
  treetop (1.4.8)
97
112
  polyglot (>= 0.3.1)
98
113
  tzinfo (0.3.23)
99
- warden (1.0.0)
100
- rack (>= 1.0.0)
101
- warden_oauth (0.1.1)
102
- oauth
103
- warden (>= 0.8.1)
104
114
 
105
115
  PLATFORMS
106
116
  ruby
107
117
 
108
118
  DEPENDENCIES
109
- devise!
110
- devise-twitter (= 0.1.1)
111
- devise_openid_authenticatable!
112
- oauth2 (= 0.0.13)
119
+ omniauth (= 0.1.1)
113
120
  rails (>= 3.0.0)
data/Rakefile CHANGED
@@ -13,9 +13,7 @@ begin
13
13
  gem.add_development_dependency "rspec", ">= 1.2.9"
14
14
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
15
  gem.add_dependency "rails", "3.0.0"
16
- gem.add_dependency 'devise_openid_authenticatable', '1.0.0.alpha7'
17
- gem.add_dependency 'devise-twitter', '0.1.1'
18
- gem.add_dependency 'oauth2', '0.0.13'
16
+ gem.add_dependency "omniauth", "0.1.1"
19
17
  end
20
18
  Jeweler::GemcutterTasks.new
21
19
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.2.0
@@ -44,9 +44,9 @@ function openidCarouselEffect() {
44
44
 
45
45
 
46
46
  jQuery(function ($) {
47
- var $form = $("form#openid");
48
- var $identity_url = $form.find("input#identity_url");
49
- var $input_area = $form.find("#openid_inputarea");
47
+ var $form = $("#openid_btns");
48
+
49
+ var $input_area = $("#openid_inputarea");
50
50
  var $input_username = $input_area.find("input#openid_username");
51
51
 
52
52
  $form.find("#nojsopenid").hide();
@@ -70,19 +70,13 @@ jQuery(function ($) {
70
70
  return false;
71
71
  }
72
72
 
73
- if(a.attr("data-real") == "false") {
74
- $identity_url.val(a.attr("href"));
75
- $form.submit();
76
- return false;
77
- }
78
-
79
73
  return true;
80
74
  });
81
75
 
82
- $form.find("#openid_inputarea_submit").click(function() {
76
+ $("#openid_inputarea_submit").click(function() {
83
77
  var v = $input_username.val();
84
78
  if(v) {
85
- $identity_url.val($input_username.attr("data-provider").replace("{user_name}",v ));
79
+ window.location = $input_username.attr("data-provider").replace("{user_name}",v );
86
80
  }
87
81
  });
88
82
 
@@ -1,12 +1,7 @@
1
1
  module Multiauth
2
2
  module ViewsHelper
3
- def multiauth_box(resource_name, url = nil)
4
- url = session_path(resource_name) if !url
5
-
6
- form_for(resource_name, :url => url, :html => {:id => "openid"}) do |f|
7
- %@<div id="nojsopenid">#{f.text_field(:identity_url, :id => "identity_url")}#{f.submit('Sign in')}</div>@+
8
- render(:partial => "multiauth/box")
9
- end
3
+ def multiauth_box
4
+ render(:partial => "multiauth/box")
10
5
  end
11
6
 
12
7
  def multiauth_assets
@@ -15,21 +10,7 @@ module Multiauth
15
10
  end
16
11
 
17
12
  def multiauth_providers
18
- mapping = request.env["devise.mapping"]
19
- providers = Multiauth::PROVIDERS
20
- if mapping && mapping.oauthable?
21
- providers.delete("Facebook") if !resource_class.oauth_providers.include?(:facebook)
22
- providers.delete("Github") if !resource_class.oauth_providers.include?(:github)
23
- else
24
- providers.delete("Facebook")
25
- providers.delete("Github")
26
- end
27
-
28
- if user_signed_in?
29
- providers["Twitter"][:url] = '/users/connect/twitter'
30
- end
31
-
32
- providers
13
+ Multiauth::PROVIDERS
33
14
  end
34
15
  end
35
16
  end
data/lib/multiauth.rb CHANGED
@@ -4,61 +4,61 @@ require 'multiauth/views_helper'
4
4
  module Multiauth
5
5
  PROVIDERS = {
6
6
  'Google' => {
7
- :url => 'https://www.google.com/accounts/o8/id'
7
+ :url => '/auth/open_id?openid_url=https://www.google.com/accounts/o8/id'
8
8
  },
9
9
  'Twitter' => {
10
- :url => '/users/sign_in/twitter',
10
+ :url => '/auth/twitter',
11
11
  :real => true
12
12
  },
13
13
  'Facebook' => {
14
- :url => lambda { oauth_authorize_url(resource_name, :facebook) },
14
+ :url => '/auth/facebook',
15
15
  :real => true
16
16
  },
17
17
  'Yahoo' => {
18
- :url => 'http://yahoo.com/'
18
+ :url => '/auth/open_id?openid_url=http://yahoo.com/'
19
19
  },
20
20
  'AOL' => {
21
- :url => 'http://openid.aol.com/{user_name}'
21
+ :url => '/auth/open_id?openid_url=http://openid.aol.com/{user_name}'
22
22
  },
23
23
  'MySpace' => {
24
- :url => 'http://www.myspace.com/{user_name}'
24
+ :url => '/auth/open_id?openid_url=http://www.myspace.com/{user_name}'
25
25
  },
26
26
  'Github' => {
27
- :url => lambda { oauth_authorize_url(resource_name, :github) },
27
+ :url => '/auth/github',
28
28
  :real => true
29
29
  },
30
30
  'MyOpenID' => {
31
- :url => 'http://{user_name}.myopenid.com/'
31
+ :url => '/auth/open_id?openid_url=http://{user_name}.myopenid.com/'
32
32
  },
33
33
  'Wordpress' => {
34
- :url => 'http://{user_name}.wordpress.com/'
34
+ :url => '/auth/open_id?openid_url=http://{user_name}.wordpress.com/'
35
35
  },
36
36
  'Blogger' => {
37
- :url => 'http://{user_name}.blogspot.com/'
37
+ :url => '/auth/open_id?openid_url=http://{user_name}.blogspot.com/'
38
38
  },
39
39
  'Flickr' => {
40
- :url => 'http://flickr.com/{user_name}/'
40
+ :url => '/auth/open_id?openid_url=http://flickr.com/{user_name}/'
41
41
  },
42
42
  'Launchpad' => {
43
- :url => 'https://launchpad.net/~{user_name}'
43
+ :url => '/auth/open_id?openid_url=https://launchpad.net/~{user_name}'
44
44
  },
45
45
  'Vidoop' => {
46
- :url => 'http://{user_name}.myvidoop.com/'
46
+ :url => '/auth/open_id?openid_url=http://{user_name}.myvidoop.com/'
47
47
  },
48
48
  'ClaimID' => {
49
- :url => 'http://claimid.com/{user_name}'
49
+ :url => '/auth/open_id?openid_url=http://claimid.com/{user_name}'
50
50
  },
51
51
  'Technorati' => {
52
- :url => 'http://technorati.com/people/technorati/{user_name}/'
52
+ :url => '/auth/open_id?openid_url=http://technorati.com/people/technorati/{user_name}/'
53
53
  },
54
54
  'Verisign' => {
55
- :url => 'http://{user_name}.pip.verisignlabs.com/'
55
+ :url => '/auth/open_id?openid_url=http://{user_name}.pip.verisignlabs.com/'
56
56
  },
57
57
  'LiveJournal' => {
58
- :url => 'http://{user_name}.livejournal.com'
58
+ :url => '/auth/open_id?openid_url=http://{user_name}.livejournal.com'
59
59
  },
60
60
  'OpenID' => {
61
- :url => '{user_name}'
61
+ :url => '/auth/open_id'
62
62
  }
63
63
  }
64
64
  end
data/multiauth.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{multiauth}
8
- s.version = "0.1.3"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David A. Cuadrado"]
12
- s.date = %q{2010-09-26}
12
+ s.date = %q{2010-10-05}
13
13
  s.description = %q{multi authentication gem using devise & co}
14
14
  s.email = %q{krawek@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -60,22 +60,16 @@ Gem::Specification.new do |s|
60
60
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
61
61
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
62
62
  s.add_runtime_dependency(%q<rails>, ["= 3.0.0"])
63
- s.add_runtime_dependency(%q<devise_openid_authenticatable>, ["= 1.0.0.alpha7"])
64
- s.add_runtime_dependency(%q<devise-twitter>, ["= 0.1.1"])
65
- s.add_runtime_dependency(%q<oauth2>, ["= 0.0.13"])
63
+ s.add_runtime_dependency(%q<omniauth>, ["= 0.1.1"])
66
64
  else
67
65
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
68
66
  s.add_dependency(%q<rails>, ["= 3.0.0"])
69
- s.add_dependency(%q<devise_openid_authenticatable>, ["= 1.0.0.alpha7"])
70
- s.add_dependency(%q<devise-twitter>, ["= 0.1.1"])
71
- s.add_dependency(%q<oauth2>, ["= 0.0.13"])
67
+ s.add_dependency(%q<omniauth>, ["= 0.1.1"])
72
68
  end
73
69
  else
74
70
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
75
71
  s.add_dependency(%q<rails>, ["= 3.0.0"])
76
- s.add_dependency(%q<devise_openid_authenticatable>, ["= 1.0.0.alpha7"])
77
- s.add_dependency(%q<devise-twitter>, ["= 0.1.1"])
78
- s.add_dependency(%q<oauth2>, ["= 0.0.13"])
72
+ s.add_dependency(%q<omniauth>, ["= 0.1.1"])
79
73
  end
80
74
  end
81
75
 
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 3
9
- version: 0.1.3
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - David A. Cuadrado
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-26 00:00:00 -05:00
17
+ date: 2010-10-05 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -48,25 +48,9 @@ dependencies:
48
48
  type: :runtime
49
49
  version_requirements: *id002
50
50
  - !ruby/object:Gem::Dependency
51
- name: devise_openid_authenticatable
51
+ name: omniauth
52
52
  prerelease: false
53
53
  requirement: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - "="
57
- - !ruby/object:Gem::Version
58
- segments:
59
- - 1
60
- - 0
61
- - 0
62
- - alpha7
63
- version: 1.0.0.alpha7
64
- type: :runtime
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: devise-twitter
68
- prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
70
54
  none: false
71
55
  requirements:
72
56
  - - "="
@@ -77,22 +61,7 @@ dependencies:
77
61
  - 1
78
62
  version: 0.1.1
79
63
  type: :runtime
80
- version_requirements: *id004
81
- - !ruby/object:Gem::Dependency
82
- name: oauth2
83
- prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - "="
88
- - !ruby/object:Gem::Version
89
- segments:
90
- - 0
91
- - 0
92
- - 13
93
- version: 0.0.13
94
- type: :runtime
95
- version_requirements: *id005
64
+ version_requirements: *id003
96
65
  description: multi authentication gem using devise & co
97
66
  email: krawek@gmail.com
98
67
  executables: []