devise_oam 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md
CHANGED
@@ -8,7 +8,7 @@ integration with Oracle Access Manager.
|
|
8
8
|
## Installation
|
9
9
|
In **Rails 3**, add this to your Gemfile and run the `bundle` command.
|
10
10
|
|
11
|
-
gem "devise_oam", "~> 0.0.
|
11
|
+
gem "devise_oam", "~> 0.0.4"
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
1) Add the `HeaderAuthenticatable` strategy in devise initializer `config/initializers/devise.rb`:
|
@@ -12,7 +12,7 @@ module DeviseOam
|
|
12
12
|
def authenticate!
|
13
13
|
oam_data = request.headers[DeviseOam.oam_header]
|
14
14
|
ldap_data = request.headers[DeviseOam.ldap_header] if DeviseOam.ldap_header
|
15
|
-
attributes = get_attributes
|
15
|
+
attributes = get_attributes
|
16
16
|
|
17
17
|
if oam_data.blank?
|
18
18
|
fail!("OAM authentication failed")
|
@@ -60,10 +60,14 @@ module DeviseOam
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def get_attributes
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
if DeviseOam.attr_headers
|
64
|
+
hash = DeviseOam.attr_headers.inject({}) {|attr_hash, attr_header|
|
65
|
+
attr_hash[attr_header.underscore] = request.headers[attr_header] if request.headers[attr_header]
|
66
|
+
attr_hash
|
67
|
+
}
|
68
|
+
else
|
69
|
+
{}
|
70
|
+
end
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
data/lib/devise_oam/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_oam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
segments:
|
148
148
|
- 0
|
149
|
-
hash:
|
149
|
+
hash: 3832047539095968395
|
150
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
151
|
none: false
|
152
152
|
requirements:
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
segments:
|
157
157
|
- 0
|
158
|
-
hash:
|
158
|
+
hash: 3832047539095968395
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
161
|
rubygems_version: 1.8.24
|