------=_Part_5640231_1792316354.1355769757603
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
----- Original Message -----
From: snmishra(a)linux.vnet.ibm.com
To: engine-devel(a)ovirt.org
Cc: snmishra(a)us.ibm.com
Sent: Monday, December 17, 2012 6:09:17 PM
Subject: [Engine-devel] LDAP: Add support for simple authentication over SSL
Hi,
IBM Tivoli Directory Server (ITDS) supports simple authentication
over SSL. What will it take to add this support? I can help with this
work item but will need some guidance.
Regards
Sharad Mishra
Hello,
There was a discussion recently regarding this.
I paste what I wrote then...
Alon
---
Hello Thierry,
If I understand correctly you wish to help in modifying the engine to support non GSSAPI
authentication methods.
Following is a quick design goals for this implementation.
I will be glad to improve this.
Alon
---
Implementation should support the following transports:
1. LDAP (plain).
2. LDAP over TLS.
3. LDAP with StartTLS.
Implementation should support the following authentication methods:
1. Simple.
2. Digest-MD5 (plain and strong).
I believe the GSSAPI can be dropped, I see no advantage of using it.
A sample of low level implementation for transport and authentication is attached.
When adding a domain the following facts should be provided:
1. Search user name.
2. Search user password.
3. Transport type (ldap, ldaps, ldap+startTLS)
4. Authentication (simple, Digest-MD5)
5. Sever selection policy (failover, round-robin, random).
6. Server address type (explicit, DNS record)
7. Server address set.
8. Optional base DN.
9. Optional root certificate.
10. Optional certificate chain.
11. Search page size.
10. Query timeout.
etc...
Within product there are two separate components that perform LDAP authentication:
1. User password validation.
2. User permission fetch.
These two components needs to work in share-nothing mode, meaning that each should
communicate with directory independently with the other.
USER PASSWORD VALIDATION
Input: user
Input: domain
Input: password
Output: DN of user
Output: success/failure
Credentials used: user/password provided.
Notes: LDAP session should not be cached.
Logic: Perform LDAP bind.
USER PERMISSION FETCH
Input: DN of user (passed by user password validation)
Input: domain (passed by user password validation)
Output: A set of permissions
Credentials used: search user and password configured within system.
Notes: LDAP context can be cached.
Logic: Perform LDAP searches, this is most of current logic.
------=_Part_5640231_1792316354.1355769757603
Content-Type: text/x-java; name=LDAPSearch.java
Content-Disposition: attachment; filename=LDAP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kJLyogQkVHSU4gU0VUVElOR1MgKi8KCQkJbGRhcC5zZXRWZXJpZnlQ
ZWVyQ2VydGlmaWNhdGUoZmFsc2UpOyAvLyBERUJVRyBPTkxZISEhCgkJCWxkYXAudXNlU3RhcnRU
TFModHJ1ZSk7CgkJCWxkYXAudXNlRGlnZXN0TUQ1KHRydWUpOwoJCQlsZGFwLnNldENyZWRlbnRp
YWxzKHVzZXIsIHBhc3N3b3JkKTsKCQkJbGRhcC5zZXRTZWFyY2hQYWdlU2l6ZSgyMCk7CgkJCS8q
IEVORCBTRVRUSU5HUyAqLwoKCQkJbGRhcC5jcmVhdGVDb250ZXh0KHVybCk7CgkJCWxkYXAuc2Vh
cmNoKAoJCQkJbmV3IER1bXBSZXN1bHRIYW5kbGVyKFN5c3RlbS5vdXQpLAoJCQkJcXVlcnksCgkJ
CQlxdWVyeUF0dHJpYnV0ZXMsCgkJCQlTZWFyY2hDb250cm9scy5TVUJUUkVFX1NDT1BFLAoJCQkJ
MzAwMDAJLy8gdGltZW91dAoJCQkpOwoJCX0KCQlmaW5hbGx5IHsKCQkJbGRhcC5kZXN0b3J5Q29u
dGV4dCgpOwoJCX0KCX0KfQo=
------=_Part_5640231_1792316354.1355769757603
Content-Type: text/x-java; name=UnsecureSSLSocketFactory.java
Content-Disposition: attachment; filename=UnsecureSSLSocketFactory.java
Content-Transfer-Encoding: base64
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEubmV0Lio7CgppbXBvcnQgamF2YXgubmV0Lio7
CmltcG9ydCBqYXZheC5uZXQuc3NsLio7CgpwdWJsaWMgY2xhc3MgVW5zZWN1cmVTU0xTb2NrZXRG
YWN0b3J5IGV4dGVuZHMgU1NMU29ja2V0RmFjdG9yeSB7CgoJcHJpdmF0ZSBzdGF0aWMgU3RyaW5n
IF9kZWZhdWx0UHJvdG9jb2wgPSAiU1NMIjsKCXByaXZhdGUgU1NMU29ja2V0RmFjdG9yeSBfbmV4
dDsKCglwdWJsaWMgc3Rh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