This question has been flagged
1 Reply
43728 Views

Hii,

I am trying to configure Odoo 12 to Authenticate with our Windows Server 2008 R2 Active Directory Users.

Here what I have done,

1. Installed LDAP module
2. LDAP Server address = 192.168.19.33
3. LDAP Server port = 389 
4. Use TLS = True
5. LDAP base = CN=Users,DC=abc,DC=com
6. LDAP filter (&(objectclass=user) (sAMAccountName=%s))
7. Sequence 10
8. LDAP binddn = admin user id
9. LDAP password = admin user pwd
10. Create User ​ = True
Template User = Created a template Odoo User (So that user password should be blank and odoo should authenticate with AD user)

Now, I have an active directory user created in Odoo with password blank. According to the LADP module if the password is blank then Odoo with authenticate with Active Directory users. 

To test, I logged in with this user but getting following error..

"

2019-06-24 14:54:16,969 4588 ERROR hrdemo odoo.addons.auth_ldap.models.res_company_ldap: An LDAP exception occurred: {'desc': 'Connect error', 'errno': 2, 'info': '(unknown error code)'}

"

Please help what is missing or wrong.

Thanks

Avatar
Discard
Author Best Answer

After a long struggle I have done it successfully.....
Here are the LDAP Server settings that worked with me.

Odoo Version I am testing on: 12 Community
Machine: Odoo is installed on a VM running on my Laptop and connected in the same Windows AD Network.
AD Server: Windows 2008 R2

1. Installed LDAP module
2. LDAP Server address = 192.168.19.33 (This is the IP address of your AD Server. Ping must be successful from your VM)
3. LDAP Server port = 389 (This is a default LDAP port)
4. Use TLS = False
5. LDAP base: OU=Accounts,DC=domain,DC=com (Here Accounts is the parent folder. In my AD structure all OU and Users are under Accounts folder. See your AD structure and take the root DN)
6. LDAP filter:
a) If you want to authenticate odoo user with AD user Login ID then use filter:  sAMAccountName=%s 
b) If you want to authenticate odoo user with AD user email then use filter: mail=%s
7. Sequence 10
8. LDAP binddn = adminuser@domain.com same as AD admin user id. You can create a new AD user with admin rights.
9. LDAP password = admin user pwd same as AD
10. Create User ​ = Checked.
a) If Create User is checked and try to login into odoo login window, in this case if you have not created your odoo user with the same AD Id or Email, odoo will create a user in odoo database if authentication is successful.
b) If Create User = Un-Checked. In this case You first have to create user in your odoo database with blank/empty password. For a trick you can create it on Odoo LDAP settings page Create and Select User Template every time and later on update with user info and rights.
11. Now your users in your odoo database have no passwords. When you login to odoo with AD ID/Email, odoo first attempts to authenticate with local password in odoo database which is empty, if password is empty then odoo attempts to authenticate with AD account.
12. Run the odoo in ubuntu terminal and keep checking login after each login attempt. It will show why LDAP authentication faild.
13. During this LDAP configutation I received many errors like LDAP bind failed, that is logical that you are on right direction. 

Avatar
Discard

Hi
i try to connect LDAP with odoo V13 and i do ur all steps but when i
try to login with any users expect admin odoo in terminal give LDAP authentication faild
if you can help me ?

Hi
I tried the same setup it is working fine in local (LAN). I tried port forwarding for VAN proxy error comes. how will I give the port address
LDAP Server address 122.185.206.210:8081
here I have given port address: 8081.