oa-enterprise 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/omniauth/strategies/saml.rb +12 -10
- data/lib/omniauth/version.rb +1 -1
- metadata +7 -7
@@ -8,11 +8,11 @@ module OmniAuth
|
|
8
8
|
autoload :AuthResponse, 'omniauth/strategies/saml/auth_response'
|
9
9
|
autoload :ValidationError, 'omniauth/strategies/saml/validation_error'
|
10
10
|
autoload :XMLSecurity, 'omniauth/strategies/saml/xml_security'
|
11
|
-
|
11
|
+
|
12
12
|
@@settings = {}
|
13
|
-
|
13
|
+
|
14
14
|
def initialize(app, options={})
|
15
|
-
super(app, :saml)
|
15
|
+
super( app, (options[:name] || :saml) )
|
16
16
|
@@settings = {
|
17
17
|
:assertion_consumer_service_url => options[:assertion_consumer_service_url],
|
18
18
|
:issuer => options[:issuer],
|
@@ -21,30 +21,32 @@ module OmniAuth
|
|
21
21
|
:name_identifier_format => options[:name_identifier_format] || "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
|
22
22
|
}
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def request_phase
|
26
26
|
request = OmniAuth::Strategies::SAML::AuthRequest.new
|
27
27
|
redirect(request.create(@@settings))
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def callback_phase
|
31
31
|
begin
|
32
32
|
response = OmniAuth::Strategies::SAML::AuthResponse.new(request.params['SAMLResponse'])
|
33
33
|
response.settings = @@settings
|
34
34
|
@name_id = response.name_id
|
35
|
+
@extra_attributes = response.attributes
|
35
36
|
return fail!(:invalid_ticket, 'Invalid SAML Ticket') if @name_id.nil? || @name_id.empty?
|
36
37
|
super
|
37
38
|
rescue ArgumentError => e
|
38
39
|
fail!(:invalid_ticket, 'Invalid SAML Response')
|
39
|
-
end
|
40
|
+
end
|
40
41
|
end
|
41
|
-
|
42
|
+
|
42
43
|
def auth_hash
|
43
44
|
OmniAuth::Utils.deep_merge(super, {
|
44
|
-
'uid' => @name_id
|
45
|
+
'uid' => @name_id,
|
46
|
+
'extra' => @extra_attributes
|
45
47
|
})
|
46
|
-
end
|
47
|
-
|
48
|
+
end
|
49
|
+
|
48
50
|
end
|
49
51
|
end
|
50
52
|
end
|
data/lib/omniauth/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oa-enterprise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James A. Rosen
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2011-
|
22
|
+
date: 2011-10-20 00:00:00 -07:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
@@ -78,12 +78,12 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
hash:
|
81
|
+
hash: 23
|
82
82
|
segments:
|
83
83
|
- 0
|
84
84
|
- 3
|
85
|
-
-
|
86
|
-
version: 0.3.
|
85
|
+
- 2
|
86
|
+
version: 0.3.2
|
87
87
|
type: :runtime
|
88
88
|
version_requirements: *id004
|
89
89
|
- !ruby/object:Gem::Dependency
|