omniauth-dice 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +28 -10
- data/lib/omniauth/dice/version.rb +1 -1
- data/lib/omniauth/strategies/dice.rb +4 -2
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de1eea3be3faeb1e1d48d6427bb459ee29e5154c
|
4
|
+
data.tar.gz: 89f2ac6f4e497c8e6be849dd0f0b172f9aeff86a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32e0341f76f988f83e0df357b40946450a9804a401e5eb36e0dedc6eac8113d081879bc8bbe148a132af6e3640a37d817b3d9afbb68bb8ca70ecffae912f416d
|
7
|
+
data.tar.gz: 80501d7343afe9689f0dba3e947cc053c6f3852b3f3a9c9f3c00fcc2aeeff1897dfc1c78ba2d722b1351cc98ba135a500edfdf4a87cc3fe8c99798032a84f0d4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -26,19 +26,37 @@ Or install it yourself with:
|
|
26
26
|
|
27
27
|
Setup your OmniAuth::Dice builder like so:
|
28
28
|
|
29
|
+
Ruby on Rails (3.0+):
|
29
30
|
```ruby
|
30
|
-
|
31
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
32
|
+
provider :dice, {
|
33
|
+
cas_server: 'https://example.org',
|
34
|
+
authentication_path: '/users',
|
35
|
+
primary_visa: 'EQUESTRIA',
|
36
|
+
dnc_options: { :transformation => 'downcase' }, # see `dnc` gem for all options
|
37
|
+
ssl_config: {
|
38
|
+
ca_file: '/path/to/your/CA.all.pem',
|
39
|
+
client_cert: '/path/to/server/cert.pem',
|
40
|
+
client_key: '/path/to/server/key.np.key'
|
41
|
+
}
|
42
|
+
}
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
Rack / Sinatra:
|
47
|
+
```ruby
|
48
|
+
use OmniAuth::Strategies::Dice, {
|
31
49
|
cas_server: 'https://example.org:3000',
|
32
50
|
authentication_path: '/dn',
|
33
51
|
format_header: 'application/xml', # default is 'application/json'
|
34
52
|
format: 'xml', # default is 'json'
|
35
53
|
primary_visa: 'EQUESTRIA', # Optional
|
36
54
|
dnc_options: { transformation: 'downcase' }, # see `dnc` gem for all options
|
37
|
-
ssl_config:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
55
|
+
ssl_config: {
|
56
|
+
ca_file: '/path/to/your/CA.all.pem',
|
57
|
+
client_cert: '/path/to/server/cert.pem',
|
58
|
+
client_key: '/path/to/server/key.np.key'
|
59
|
+
}
|
42
60
|
}
|
43
61
|
```
|
44
62
|
|
@@ -67,14 +85,14 @@ Full configuration options are as follows:
|
|
67
85
|
`Faraday` (the HTTP library used by OmniAuth) can accept certificate paths:
|
68
86
|
|
69
87
|
```
|
70
|
-
client_cert: '
|
71
|
-
client_key: '
|
88
|
+
client_cert: 'path/to/server/cert.pem',
|
89
|
+
client_key: 'path/to/server/key.np.pem'
|
72
90
|
```
|
73
91
|
|
74
92
|
Or it also works with actual certificates (such as to pass a passphrase in):
|
75
93
|
```
|
76
|
-
client_cert: File.read('
|
77
|
-
client_key: OpenSSL::PKey::RSA.new(File.read('
|
94
|
+
client_cert: File.read('path/to/server/cert.pem').to_cert,
|
95
|
+
client_key: OpenSSL::PKey::RSA.new(File.read('path/to/server/key.pem'), 'PASSW0RD')
|
78
96
|
```
|
79
97
|
|
80
98
|
## Contributing
|
@@ -100,7 +100,7 @@ module OmniAuth
|
|
100
100
|
@data = parse_response_data
|
101
101
|
session['omniauth.auth'] ||= auth_hash
|
102
102
|
|
103
|
-
|
103
|
+
super
|
104
104
|
end
|
105
105
|
|
106
106
|
def auth_hash
|
@@ -317,6 +317,7 @@ module OmniAuth
|
|
317
317
|
def parse_response_data
|
318
318
|
log :debug, '.parse_response_data'
|
319
319
|
log :debug, "cas_server response.body:\r\n#{@raw_data}"
|
320
|
+
formatted_data = nil
|
320
321
|
unless @raw_data.class == Hash # Webmock hack
|
321
322
|
case options.format.to_sym
|
322
323
|
when :json
|
@@ -324,8 +325,9 @@ module OmniAuth
|
|
324
325
|
when :xml
|
325
326
|
formatted_data = MultiXml.parse(@raw_data)['userinfo']
|
326
327
|
end
|
327
|
-
log :debug, "Formatted response.body data: #{formatted_data}"
|
328
328
|
end
|
329
|
+
formatted_data = formatted_data.nil? ? @raw_data : formatted_data
|
330
|
+
log :debug, "Formatted response.body data: #{formatted_data}"
|
329
331
|
|
330
332
|
formatted_data
|
331
333
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-dice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Haddox
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
42qdwEXvvkODZAD6KAIXPdmbMfBgPbcd+B/4eUA0PyKo+4dgL1NuqX4MPWToevIZ
|
31
31
|
O8EKLF2X7NmC6FY1bOsSj/J8r1SOkx0rxgF+geRvY1P+hfNjDfxTsjU=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-02-
|
33
|
+
date: 2015-02-07 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: awesome_print
|
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
407
407
|
version: '0'
|
408
408
|
requirements: []
|
409
409
|
rubyforge_project:
|
410
|
-
rubygems_version: 2.
|
410
|
+
rubygems_version: 2.4.4
|
411
411
|
signing_key:
|
412
412
|
specification_version: 4
|
413
413
|
summary: DN Interoperable Conversion Expert Strategy
|
metadata.gz.sig
CHANGED
Binary file
|