casino_core-authenticator-ldap 0.0.2 → 0.0.3
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/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/casino_core/authenticator/ldap.rb +5 -2
- data/lib/casino_core/authenticator/ldap/version.rb +1 -1
- metadata +2 -9
- data/VERSION +0 -1
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -6,11 +6,11 @@ To use the LDAP authenticator, configure it in your cas.yml:
|
|
|
6
6
|
|
|
7
7
|
authenticators:
|
|
8
8
|
my_company_ldap:
|
|
9
|
-
authenticator: "
|
|
9
|
+
authenticator: "LDAP"
|
|
10
10
|
options:
|
|
11
11
|
host: "localhost"
|
|
12
|
-
port:
|
|
13
|
-
base: "dc=
|
|
12
|
+
port: 636
|
|
13
|
+
base: "ou=people,dc=example,dc=com"
|
|
14
14
|
username_attribute: "uid"
|
|
15
15
|
encryption: "simple_tls"
|
|
16
16
|
extra_attributes:
|
|
@@ -18,7 +18,7 @@ To use the LDAP authenticator, configure it in your cas.yml:
|
|
|
18
18
|
fullname: "displayname"
|
|
19
19
|
|
|
20
20
|
## Contributing to casino_core-authenticator-ldap
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
|
23
23
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
|
24
24
|
* Fork the project.
|
|
@@ -42,6 +42,9 @@ class CASinoCore::Authenticator::LDAP
|
|
|
42
42
|
@ldap.auth(@options[:admin_user], @options[:admin_password])
|
|
43
43
|
end
|
|
44
44
|
@user_plain = @ldap.bind_as(:base => @options[:base], :size => 1, :password => @password, :filter => user_filter)
|
|
45
|
+
if @user_plain.is_a?(Array)
|
|
46
|
+
@user_plain = @user_plain.first
|
|
47
|
+
end
|
|
45
48
|
end
|
|
46
49
|
|
|
47
50
|
def username_attribute
|
|
@@ -58,7 +61,7 @@ class CASinoCore::Authenticator::LDAP
|
|
|
58
61
|
|
|
59
62
|
def generate_user
|
|
60
63
|
@user = {
|
|
61
|
-
username: @user_plain[username_attribute]
|
|
64
|
+
username: @user_plain[username_attribute].first,
|
|
62
65
|
extra_attributes: extra_attributes
|
|
63
66
|
}
|
|
64
67
|
end
|
|
@@ -69,7 +72,7 @@ class CASinoCore::Authenticator::LDAP
|
|
|
69
72
|
@options[:extra_attributes].each do |index_result, index_ldap|
|
|
70
73
|
value = @user_plain[index_ldap]
|
|
71
74
|
if value
|
|
72
|
-
result[index_result] = value
|
|
75
|
+
result[index_result] = value.first
|
|
73
76
|
end
|
|
74
77
|
end
|
|
75
78
|
result
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: casino_core-authenticator-ldap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
12
|
+
date: 2013-02-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|
|
@@ -108,7 +108,6 @@ files:
|
|
|
108
108
|
- LICENSE.txt
|
|
109
109
|
- README.md
|
|
110
110
|
- Rakefile
|
|
111
|
-
- VERSION
|
|
112
111
|
- casino_core-authenticator-ldap.gemspec
|
|
113
112
|
- lib/casino_core-authenticator-ldap.rb
|
|
114
113
|
- lib/casino_core/authenticator/ldap.rb
|
|
@@ -128,18 +127,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
128
127
|
- - ! '>='
|
|
129
128
|
- !ruby/object:Gem::Version
|
|
130
129
|
version: '0'
|
|
131
|
-
segments:
|
|
132
|
-
- 0
|
|
133
|
-
hash: -2937195477665690854
|
|
134
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
131
|
none: false
|
|
136
132
|
requirements:
|
|
137
133
|
- - ! '>='
|
|
138
134
|
- !ruby/object:Gem::Version
|
|
139
135
|
version: '0'
|
|
140
|
-
segments:
|
|
141
|
-
- 0
|
|
142
|
-
hash: -2937195477665690854
|
|
143
136
|
requirements: []
|
|
144
137
|
rubyforge_project:
|
|
145
138
|
rubygems_version: 1.8.24
|
data/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.0.1
|