omniauth-openid 1.0.0.beta1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -1
- data/.rspec +1 -1
- data/.travis.yml +23 -0
- data/Gemfile +8 -7
- data/Gemfile.lock +64 -58
- data/README.md +7 -15
- data/lib/omniauth-openid/version.rb +1 -1
- data/omniauth-openid.gemspec +5 -12
- data/spec/omniauth/strategies/open_id_spec.rb +36 -37
- data/spec/spec_helper.rb +4 -0
- metadata +35 -104
- data/lib/oa-openid.rb +0 -1
- data/lib/omniauth/strategies/google_apps.rb +0 -23
- data/lib/omniauth/strategies/google_hybrid.rb +0 -55
- data/lib/omniauth/strategies/steam.rb +0 -55
- data/lib/omniauth/version.rb +0 -5
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 13be670416c096d0ac1f7a7f5248d5b58e806b3b69883eafafc25ed83c230ee5
|
4
|
+
data.tar.gz: a3b59e5573339f46695c9e8ed92858f5d9e3f5990c646299f7989d95afbd8791
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e92d418d26125e3522d4c122e940502795b0cbf73940dfa4d2c8c6deae37b5c7fff95f3c88f4589cf1328041e9524ff4acdb355f15e2b008aec8c0e2ed30c248
|
7
|
+
data.tar.gz: 8a23a7180d5a08a8ede236d7ab92d5471b23e4940250e4094f83be6c72388ee46e5b3728831d115cac762637711589756e7477a7402a136ae004532205e63c74
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
--color
|
2
|
-
--format
|
2
|
+
--format progress
|
data/.travis.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
bundler_args: --without development
|
2
|
+
before_install:
|
3
|
+
- gem update --system
|
4
|
+
- gem update bundler
|
5
|
+
cache: bundler
|
6
|
+
env:
|
7
|
+
global:
|
8
|
+
- JRUBY_OPTS="$JRUBY_OPTS --debug"
|
9
|
+
language: ruby
|
10
|
+
rvm:
|
11
|
+
- jruby-9.2.14.0
|
12
|
+
- 2.4.10
|
13
|
+
- 2.5.8
|
14
|
+
- 2.6.6
|
15
|
+
- 2.7.2
|
16
|
+
- jruby-head
|
17
|
+
- ruby-head
|
18
|
+
matrix:
|
19
|
+
allow_failures:
|
20
|
+
- rvm: jruby-head
|
21
|
+
- rvm: ruby-head
|
22
|
+
fast_finish: true
|
23
|
+
sudo: false
|
data/Gemfile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require File.expand_path('../lib/omniauth/version', __FILE__)
|
2
|
-
|
3
1
|
source 'http://rubygems.org'
|
4
2
|
|
3
|
+
gem 'rake', '~> 12.0'
|
4
|
+
|
5
5
|
platforms :jruby do
|
6
|
-
gem 'jruby-openssl', '~> 0.
|
6
|
+
gem 'jruby-openssl', '~> 0.9'
|
7
7
|
end
|
8
8
|
|
9
9
|
gem 'ruby-openid', '2.1.8', :git => 'git://github.com/mbleigh/ruby-openid.git'
|
@@ -11,10 +11,11 @@ gem 'ruby-openid', '2.1.8', :git => 'git://github.com/mbleigh/ruby-openid.git'
|
|
11
11
|
gemspec
|
12
12
|
|
13
13
|
group :development, :test do
|
14
|
-
gem '
|
15
|
-
gem '
|
16
|
-
gem '
|
17
|
-
gem '
|
14
|
+
gem 'rack-test'
|
15
|
+
gem 'rspec', '>= 3.0'
|
16
|
+
gem 'simplecov', '>= 0.9'
|
17
|
+
gem 'webmock', '~> 3.0'
|
18
|
+
gem 'yard', '>= 0.9.11'
|
18
19
|
end
|
19
20
|
|
20
21
|
group :example do
|
data/Gemfile.lock
CHANGED
@@ -7,76 +7,82 @@ GIT
|
|
7
7
|
PATH
|
8
8
|
remote: .
|
9
9
|
specs:
|
10
|
-
omniauth-openid (
|
11
|
-
omniauth (
|
12
|
-
rack-openid (~> 1.
|
10
|
+
omniauth-openid (2.0.1)
|
11
|
+
omniauth (>= 1.0, < 3.0)
|
12
|
+
rack-openid (~> 1.4.0)
|
13
13
|
|
14
14
|
GEM
|
15
15
|
remote: http://rubygems.org/
|
16
16
|
specs:
|
17
|
-
addressable (2.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
omniauth (
|
28
|
-
hashie
|
29
|
-
rack
|
30
|
-
|
31
|
-
|
17
|
+
addressable (2.7.0)
|
18
|
+
public_suffix (>= 2.0.2, < 5.0)
|
19
|
+
crack (0.4.5)
|
20
|
+
rexml
|
21
|
+
diff-lcs (1.4.4)
|
22
|
+
docile (1.3.5)
|
23
|
+
hashdiff (1.0.1)
|
24
|
+
hashie (4.1.0)
|
25
|
+
mustermann (1.1.1)
|
26
|
+
ruby2_keywords (~> 0.0.1)
|
27
|
+
omniauth (2.0.1)
|
28
|
+
hashie (>= 3.4.6)
|
29
|
+
rack (>= 1.6.2, < 3)
|
30
|
+
rack-protection
|
31
|
+
public_suffix (4.0.6)
|
32
|
+
rack (2.2.3)
|
33
|
+
rack-openid (1.4.2)
|
32
34
|
rack (>= 1.1.0)
|
33
35
|
ruby-openid (>= 2.1.8)
|
34
|
-
rack-protection (
|
36
|
+
rack-protection (2.1.0)
|
35
37
|
rack
|
36
|
-
rack-test (
|
37
|
-
rack (>= 1.0)
|
38
|
-
rake (
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
rspec-
|
43
|
-
rspec-
|
44
|
-
|
45
|
-
|
46
|
-
rspec-expectations (
|
47
|
-
diff-lcs (
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
38
|
+
rack-test (1.1.0)
|
39
|
+
rack (>= 1.0, < 3)
|
40
|
+
rake (12.3.3)
|
41
|
+
rexml (3.2.4)
|
42
|
+
rspec (3.10.0)
|
43
|
+
rspec-core (~> 3.10.0)
|
44
|
+
rspec-expectations (~> 3.10.0)
|
45
|
+
rspec-mocks (~> 3.10.0)
|
46
|
+
rspec-core (3.10.1)
|
47
|
+
rspec-support (~> 3.10.0)
|
48
|
+
rspec-expectations (3.10.1)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.10.0)
|
51
|
+
rspec-mocks (3.10.1)
|
52
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
53
|
+
rspec-support (~> 3.10.0)
|
54
|
+
rspec-support (3.10.1)
|
55
|
+
ruby2_keywords (0.0.4)
|
56
|
+
simplecov (0.18.5)
|
57
|
+
docile (~> 1.1)
|
58
|
+
simplecov-html (~> 0.11)
|
59
|
+
simplecov-html (0.12.3)
|
60
|
+
sinatra (2.1.0)
|
61
|
+
mustermann (~> 1.0)
|
62
|
+
rack (~> 2.2)
|
63
|
+
rack-protection (= 2.1.0)
|
64
|
+
tilt (~> 2.0)
|
65
|
+
tilt (2.0.10)
|
66
|
+
webmock (3.11.1)
|
67
|
+
addressable (>= 2.3.6)
|
68
|
+
crack (>= 0.3.2)
|
69
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
70
|
+
yard (0.9.26)
|
63
71
|
|
64
72
|
PLATFORMS
|
65
73
|
ruby
|
66
74
|
|
67
75
|
DEPENDENCIES
|
68
|
-
|
69
|
-
guard
|
70
|
-
guard-rspec
|
71
|
-
jruby-openssl (~> 0.7)
|
76
|
+
jruby-openssl (~> 0.9)
|
72
77
|
omniauth-openid!
|
73
|
-
rack-test
|
74
|
-
rake (~> 0
|
75
|
-
|
76
|
-
rdiscount (~> 1.6)
|
77
|
-
rspec (~> 2.5)
|
78
|
+
rack-test
|
79
|
+
rake (~> 12.0)
|
80
|
+
rspec (>= 3.0)
|
78
81
|
ruby-openid (= 2.1.8)!
|
79
|
-
simplecov (
|
82
|
+
simplecov (>= 0.9)
|
80
83
|
sinatra
|
81
|
-
webmock (~>
|
82
|
-
yard (
|
84
|
+
webmock (~> 3.0)
|
85
|
+
yard (>= 0.9.11)
|
86
|
+
|
87
|
+
BUNDLED WITH
|
88
|
+
2.2.5
|
data/README.md
CHANGED
@@ -4,25 +4,19 @@ Provides strategies for authenticating to providers using the OpenID standard.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
gem install oa-openid
|
10
|
-
|
11
|
-
For the full auth suite:
|
12
|
-
|
13
|
-
gem install omniauth
|
7
|
+
gem install omniauth-openid
|
14
8
|
|
15
9
|
## Stand-Alone Example
|
16
10
|
|
17
11
|
Use the strategy as a middleware in your application:
|
18
12
|
|
19
|
-
require 'omniauth
|
13
|
+
require 'omniauth-openid'
|
20
14
|
require 'openid/store/filesystem'
|
21
15
|
|
22
16
|
use Rack::Session::Cookie
|
23
|
-
use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new('/tmp')
|
17
|
+
use OmniAuth::Strategies::OpenID, :store => OpenID::Store::Filesystem.new('/tmp')
|
24
18
|
|
25
|
-
Then simply direct users to
|
19
|
+
Then simply direct users to `/auth/open_id` to prompt them for their OpenID identifier. You may also pre-set the identifier by passing an `identifier` parameter to the URL (Example: `/auth/open_id?openid_url=yahoo.com`).
|
26
20
|
|
27
21
|
A list of all OpenID stores is available at http://github.com/openid/ruby-openid/tree/master/lib/openid/store/
|
28
22
|
|
@@ -30,13 +24,11 @@ A list of all OpenID stores is available at http://github.com/openid/ruby-openid
|
|
30
24
|
|
31
25
|
If OpenID is one of several authentication strategies, use the OmniAuth Builder:
|
32
26
|
|
33
|
-
require 'omniauth
|
34
|
-
require 'omniauth/basic' # for Campfire
|
27
|
+
require 'omniauth-openid'
|
35
28
|
require 'openid/store/filesystem'
|
36
29
|
|
37
30
|
use OmniAuth::Builder do
|
38
|
-
provider :open_id, OpenID::Store::Filesystem.new('/tmp')
|
39
|
-
provider :campfire
|
31
|
+
provider :open_id, :store => OpenID::Store::Filesystem.new('/tmp')
|
40
32
|
end
|
41
33
|
|
42
34
|
## Configured Identifiers
|
@@ -44,7 +36,7 @@ If OpenID is one of several authentication strategies, use the OmniAuth Builder:
|
|
44
36
|
You may pre-configure an OpenID identifier. For example, to use Google's main OpenID endpoint:
|
45
37
|
|
46
38
|
use OmniAuth::Builder do
|
47
|
-
provider :open_id,
|
39
|
+
provider :open_id, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
|
48
40
|
end
|
49
41
|
|
50
42
|
Note the use of nil, which will trigger ruby-openid's default Memory Store.
|
data/omniauth-openid.gemspec
CHANGED
@@ -2,24 +2,17 @@
|
|
2
2
|
require File.expand_path('../lib/omniauth-openid/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
+
gem.add_dependency 'omniauth', ['>= 1.0', '< 3.0']
|
6
|
+
gem.add_dependency 'rack-openid', '~> 1.4.0'
|
5
7
|
|
6
|
-
gem.
|
7
|
-
gem.add_dependency 'rack-openid', '~> 1.3.1'
|
8
|
-
gem.add_development_dependency 'rack-test', '~> 0.5'
|
9
|
-
gem.add_development_dependency 'rake', '~> 0.8'
|
10
|
-
gem.add_development_dependency 'rdiscount', '~> 1.6'
|
11
|
-
gem.add_development_dependency 'rspec', '~> 2.5'
|
12
|
-
gem.add_development_dependency 'simplecov', '~> 0.4'
|
13
|
-
gem.add_development_dependency 'webmock', '~> 1.7'
|
14
|
-
gem.add_development_dependency 'yard', '~> 0.7'
|
15
|
-
|
16
|
-
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
|
8
|
+
gem.authors = ['Michael Bleigh', 'Erik Michaels-Ober', 'Tom Milewski']
|
17
9
|
gem.description = %q{OpenID strategy for OmniAuth.}
|
18
|
-
gem.email = ['michael@intridea.com', 'sferik@gmail.com']
|
10
|
+
gem.email = ['michael@intridea.com', 'sferik@gmail.com', 'tmilewski@gmail.com']
|
19
11
|
gem.files = `git ls-files`.split("\n")
|
20
12
|
gem.homepage = 'https://github.com/intridea/omniauth-openid'
|
21
13
|
gem.name = 'omniauth-openid'
|
22
14
|
gem.require_paths = ['lib']
|
15
|
+
gem.license = 'MIT'
|
23
16
|
gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
|
24
17
|
gem.summary = gem.description
|
25
18
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -6,7 +6,7 @@ describe OmniAuth::Strategies::OpenID, :type => :strategy do
|
|
6
6
|
def app
|
7
7
|
strat = OmniAuth::Strategies::OpenID
|
8
8
|
Rack::Builder.new {
|
9
|
-
use Rack::Session::Cookie
|
9
|
+
use Rack::Session::Cookie, secret: 'foobar'
|
10
10
|
use strat
|
11
11
|
run lambda {|env| [404, {'Content-Type' => 'text/plain'}, [nil || env.key?('omniauth.auth').to_s]] }
|
12
12
|
}.to_app
|
@@ -18,59 +18,59 @@ describe OmniAuth::Strategies::OpenID, :type => :strategy do
|
|
18
18
|
|
19
19
|
describe '/auth/open_id without an identifier URL' do
|
20
20
|
before do
|
21
|
-
|
21
|
+
post '/auth/open_id'
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'should respond with OK' do
|
25
|
-
last_response.
|
25
|
+
expect(last_response).to be_ok
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'should respond with HTML' do
|
29
|
-
last_response.content_type.
|
29
|
+
expect(last_response.content_type).to eq 'text/html'
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'should render an identifier URL input' do
|
33
|
-
last_response.body.
|
33
|
+
expect(last_response.body).to match %r{<input[^>]*openid_url}
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
#describe '/auth/open_id with an identifier URL' do
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#end
|
37
|
+
# describe '/auth/open_id with an identifier URL' do
|
38
|
+
# context 'successful' do
|
39
|
+
# before do
|
40
|
+
# @identifier_url = 'http://me.example.org'
|
41
|
+
# # TODO: change this mock to actually return some sort of OpenID response
|
42
|
+
# stub_request(:get, @identifier_url)
|
43
|
+
# get '/auth/open_id?openid_url=' + @identifier_url
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# it 'should redirect to the OpenID identity URL' do
|
47
|
+
# last_response.should be_redirect
|
48
|
+
# last_response.headers['Location'].should =~ %r{^#{@identifier_url}.*}
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# it 'should tell the OpenID server to return to the callback URL' do
|
52
|
+
# return_to = CGI.escape(last_request.url + '/callback')
|
53
|
+
# last_response.headers['Location'].should =~ %r{[\?&]openid.return_to=#{return_to}}
|
54
|
+
# end
|
55
|
+
# end
|
56
|
+
# end
|
57
57
|
|
58
58
|
describe 'followed by /auth/open_id/callback' do
|
59
59
|
context 'successful' do
|
60
|
-
#before do
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#end
|
60
|
+
# before do
|
61
|
+
# @identifier_url = 'http://me.example.org'
|
62
|
+
# # TODO: change this mock to actually return some sort of OpenID response
|
63
|
+
# stub_request(:get, @identifier_url)
|
64
|
+
# get '/auth/open_id/callback'
|
65
|
+
# end
|
66
66
|
|
67
67
|
it "should set provider to open_id"
|
68
68
|
it "should create auth_hash based on sreg"
|
69
69
|
it "should create auth_hash based on ax"
|
70
70
|
|
71
|
-
#it 'should call through to the master app' do
|
72
|
-
#
|
73
|
-
#end
|
71
|
+
# it 'should call through to the master app' do
|
72
|
+
# last_response.body.should == 'true'
|
73
|
+
# end
|
74
74
|
end
|
75
75
|
|
76
76
|
context 'unsuccessful' do
|
@@ -81,11 +81,10 @@ describe OmniAuth::Strategies::OpenID, :type => :strategy do
|
|
81
81
|
|
82
82
|
it 'it should redirect to invalid credentials' do
|
83
83
|
pending
|
84
|
-
last_response.
|
85
|
-
last_response.
|
84
|
+
expect(last_response).to be_redirect
|
85
|
+
expect(last_response).to match %r{invalid_credentials}
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
90
|
-
|
91
90
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,128 +1,65 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-openid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease: 6
|
4
|
+
version: 2.0.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Michael Bleigh
|
9
8
|
- Erik Michaels-Ober
|
9
|
+
- Tom Milewski
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-01-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: omniauth
|
17
|
-
requirement:
|
18
|
-
none: false
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
19
18
|
requirements:
|
20
|
-
- -
|
19
|
+
- - ">="
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0
|
23
|
-
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: *70281189852360
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: rack-openid
|
28
|
-
requirement: &70281189851840 !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
21
|
+
version: '1.0'
|
22
|
+
- - "<"
|
32
23
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
24
|
+
version: '3.0'
|
34
25
|
type: :runtime
|
35
26
|
prerelease: false
|
36
|
-
version_requirements:
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rack-test
|
39
|
-
requirement: &70281189851380 !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
|
-
requirements:
|
42
|
-
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
version: '0.5'
|
45
|
-
type: :development
|
46
|
-
prerelease: false
|
47
|
-
version_requirements: *70281189851380
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: rake
|
50
|
-
requirement: &70281189850920 !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
|
-
requirements:
|
53
|
-
- - ~>
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0.8'
|
56
|
-
type: :development
|
57
|
-
prerelease: false
|
58
|
-
version_requirements: *70281189850920
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: rdiscount
|
61
|
-
requirement: &70281189850460 !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
28
|
requirements:
|
64
|
-
- -
|
29
|
+
- - ">="
|
65
30
|
- !ruby/object:Gem::Version
|
66
|
-
version: '1.
|
67
|
-
|
68
|
-
prerelease: false
|
69
|
-
version_requirements: *70281189850460
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rspec
|
72
|
-
requirement: &70281189850000 !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ~>
|
31
|
+
version: '1.0'
|
32
|
+
- - "<"
|
76
33
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
78
|
-
type: :development
|
79
|
-
prerelease: false
|
80
|
-
version_requirements: *70281189850000
|
34
|
+
version: '3.0'
|
81
35
|
- !ruby/object:Gem::Dependency
|
82
|
-
name:
|
83
|
-
requirement:
|
84
|
-
none: false
|
85
|
-
requirements:
|
86
|
-
- - ~>
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0.4'
|
89
|
-
type: :development
|
90
|
-
prerelease: false
|
91
|
-
version_requirements: *70281189849540
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
|
-
name: webmock
|
94
|
-
requirement: &70281189849080 !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
36
|
+
name: rack-openid
|
37
|
+
requirement: !ruby/object:Gem::Requirement
|
96
38
|
requirements:
|
97
|
-
- - ~>
|
39
|
+
- - "~>"
|
98
40
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
100
|
-
type: :
|
41
|
+
version: 1.4.0
|
42
|
+
type: :runtime
|
101
43
|
prerelease: false
|
102
|
-
version_requirements:
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: yard
|
105
|
-
requirement: &70281189848580 !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
45
|
requirements:
|
108
|
-
- - ~>
|
46
|
+
- - "~>"
|
109
47
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
111
|
-
type: :development
|
112
|
-
prerelease: false
|
113
|
-
version_requirements: *70281189848580
|
48
|
+
version: 1.4.0
|
114
49
|
description: OpenID strategy for OmniAuth.
|
115
50
|
email:
|
116
51
|
- michael@intridea.com
|
117
52
|
- sferik@gmail.com
|
53
|
+
- tmilewski@gmail.com
|
118
54
|
executables: []
|
119
55
|
extensions: []
|
120
56
|
extra_rdoc_files: []
|
121
57
|
files:
|
122
|
-
- .gemtest
|
123
|
-
- .gitignore
|
124
|
-
- .rspec
|
125
|
-
- .
|
58
|
+
- ".gemtest"
|
59
|
+
- ".gitignore"
|
60
|
+
- ".rspec"
|
61
|
+
- ".travis.yml"
|
62
|
+
- ".yardopts"
|
126
63
|
- Gemfile
|
127
64
|
- Gemfile.lock
|
128
65
|
- Guardfile
|
@@ -130,40 +67,34 @@ files:
|
|
130
67
|
- README.md
|
131
68
|
- Rakefile
|
132
69
|
- examples/sinatra.rb
|
133
|
-
- lib/oa-openid.rb
|
134
70
|
- lib/omniauth-openid.rb
|
135
71
|
- lib/omniauth-openid/version.rb
|
136
|
-
- lib/omniauth/strategies/google_apps.rb
|
137
|
-
- lib/omniauth/strategies/google_hybrid.rb
|
138
72
|
- lib/omniauth/strategies/open_id.rb
|
139
|
-
- lib/omniauth/strategies/steam.rb
|
140
|
-
- lib/omniauth/version.rb
|
141
73
|
- omniauth-openid.gemspec
|
142
74
|
- spec/omniauth/strategies/open_id_spec.rb
|
143
75
|
- spec/spec_helper.rb
|
144
76
|
homepage: https://github.com/intridea/omniauth-openid
|
145
|
-
licenses:
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata: {}
|
146
80
|
post_install_message:
|
147
81
|
rdoc_options: []
|
148
82
|
require_paths:
|
149
83
|
- lib
|
150
84
|
required_ruby_version: !ruby/object:Gem::Requirement
|
151
|
-
none: false
|
152
85
|
requirements:
|
153
|
-
- -
|
86
|
+
- - ">="
|
154
87
|
- !ruby/object:Gem::Version
|
155
88
|
version: '0'
|
156
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
-
none: false
|
158
90
|
requirements:
|
159
|
-
- -
|
91
|
+
- - ">="
|
160
92
|
- !ruby/object:Gem::Version
|
161
|
-
version: 1.3.
|
93
|
+
version: 1.3.6
|
162
94
|
requirements: []
|
163
|
-
|
164
|
-
rubygems_version: 1.8.10
|
95
|
+
rubygems_version: 3.0.0
|
165
96
|
signing_key:
|
166
|
-
specification_version:
|
97
|
+
specification_version: 4
|
167
98
|
summary: OpenID strategy for OmniAuth.
|
168
99
|
test_files:
|
169
100
|
- spec/omniauth/strategies/open_id_spec.rb
|
data/lib/oa-openid.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'omniauth/openid'
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'omniauth/openid'
|
2
|
-
|
3
|
-
module OmniAuth
|
4
|
-
module Strategies
|
5
|
-
class GoogleApps < OmniAuth::Strategies::OpenID
|
6
|
-
def initialize(app, store = nil, options = {}, &block)
|
7
|
-
options[:name] ||= 'google_apps'
|
8
|
-
super(app, store, options, &block)
|
9
|
-
end
|
10
|
-
|
11
|
-
def get_identifier
|
12
|
-
OmniAuth::Form.build(:title => 'Google Apps Authentication') do
|
13
|
-
label_field('Google Apps Domain', 'domain')
|
14
|
-
input_field('url', 'domain')
|
15
|
-
end.to_response
|
16
|
-
end
|
17
|
-
|
18
|
-
def identifier
|
19
|
-
options[:domain] || request['domain']
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'rack/openid'
|
2
|
-
require 'omniauth/openid'
|
3
|
-
require 'oauth'
|
4
|
-
|
5
|
-
module OmniAuth
|
6
|
-
module Strategies
|
7
|
-
# OmniAuth strategy for connecting to Google via the OpenID+OAuth Hybrid Protocol.
|
8
|
-
# For help, check the example implementation on https://github.com/boyvanamstel/Google-Hybrid-Omniauth-implementation
|
9
|
-
class GoogleHybrid < OmniAuth::Strategies::OpenID
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def dummy_app
|
14
|
-
lambda{|env| [401, {"WWW-Authenticate" => Rack::OpenID.build_header(
|
15
|
-
:identifier => identifier,
|
16
|
-
:return_to => callback_url,
|
17
|
-
:required => @options[:required],
|
18
|
-
:optional => @options[:optional],
|
19
|
-
:"oauth[consumer]" => @options[:consumer_key],
|
20
|
-
:"oauth[scope]" => @options[:scope],
|
21
|
-
:method => 'post'
|
22
|
-
)}, []]}
|
23
|
-
end
|
24
|
-
|
25
|
-
def auth_hash
|
26
|
-
# Based on https://gist.github.com/569650 by nov
|
27
|
-
oauth_response = ::OpenID::OAuth::Response.from_success_response(@openid_response)
|
28
|
-
|
29
|
-
consumer = ::OAuth::Consumer.new(
|
30
|
-
@options[:consumer_key],
|
31
|
-
@options[:consumer_secret],
|
32
|
-
:site => 'https://www.google.com',
|
33
|
-
:access_token_path => '/accounts/OAuthGetAccessToken'
|
34
|
-
)
|
35
|
-
request_token = ::OAuth::RequestToken.new(
|
36
|
-
consumer,
|
37
|
-
oauth_response.request_token,
|
38
|
-
"" # OAuth request token secret is also blank in OpenID/OAuth Hybrid
|
39
|
-
)
|
40
|
-
@access_token = request_token.get_access_token
|
41
|
-
|
42
|
-
OmniAuth::Utils.deep_merge(super(), {
|
43
|
-
'uid' => @openid_response.display_identifier,
|
44
|
-
'user_info' => user_info(@openid_response),
|
45
|
-
'credentials' => {
|
46
|
-
'scope' => @options[:scope],
|
47
|
-
'token' => @access_token.token,
|
48
|
-
'secret' => @access_token.secret
|
49
|
-
}
|
50
|
-
})
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'omniauth/openid'
|
2
|
-
module OmniAuth
|
3
|
-
module Strategies
|
4
|
-
class Steam < OmniAuth::Strategies::OpenID
|
5
|
-
def initialize(app, store = nil, api_key = nil, options = {}, &block)
|
6
|
-
options[:identifier] ||= "http://steamcommunity.com/openid"
|
7
|
-
options[:name] ||= 'steam'
|
8
|
-
@api_key = api_key
|
9
|
-
super(app, store, options, &block)
|
10
|
-
end
|
11
|
-
|
12
|
-
def user_info(response=nil)
|
13
|
-
player = user_hash['response']['players']['player'].first
|
14
|
-
nickname = player["personaname"]
|
15
|
-
name = player["realname"]
|
16
|
-
url = player["profileurl"]
|
17
|
-
country = player["loccountrycode"]
|
18
|
-
state = player["locstatecode"]
|
19
|
-
city = player["loccityid"]
|
20
|
-
|
21
|
-
{
|
22
|
-
'nickname' => nickname,
|
23
|
-
'name' => name,
|
24
|
-
'url' => url,
|
25
|
-
'location' => "#{city}, #{state}, #{country}"
|
26
|
-
}
|
27
|
-
end
|
28
|
-
|
29
|
-
def user_hash
|
30
|
-
# Steam provides no information back on a openid response other than a 64bit user id
|
31
|
-
# Need to use this information and make a API call to get user information from steam.
|
32
|
-
if @api_key
|
33
|
-
unless @user_hash
|
34
|
-
uri = URI.parse("http://api.steampowered.com/")
|
35
|
-
req = Net::HTTP::Get.new("#{uri.path}ISteamUser/GetPlayerSummaries/v0001/?key=#{@api_key}&steamids=#{@openid_response.display_identifier.split("/").last}")
|
36
|
-
res = Net::HTTP.start(uri.host, uri.port) {|http|
|
37
|
-
http.request(req)
|
38
|
-
}
|
39
|
-
end
|
40
|
-
@user_hash ||= MultiJson.decode(res.body)
|
41
|
-
else
|
42
|
-
{}
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def auth_hash
|
47
|
-
OmniAuth::Utils.deep_merge(super, {
|
48
|
-
'uid' => @openid_response.display_identifier.split("/").last,
|
49
|
-
'user_info' => user_info,
|
50
|
-
'extra' => {'user_hash' => user_hash}
|
51
|
-
})
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|