Can you turn on debug logging and show the failure stack?
I know that Dmitiry's changes to get this to work for me were post 2.1...
Can you try adding principal-pattern element into context element with a specific user OU?
<context>
<principal-pattern>cn={0},OU=Users,OU=your-domain,DC=your-domain,DC=com</principal-pattern>
...
-----Original Message-----
From: Ford, Thomas [mailto:***@nflc.umd.edu]
Sent: Monday, July 07, 2014 9:03 AM
To: Misztur, Chris; Adam Retter
Cc: exist-***@lists.sourceforge.net
Subject: RE: [Exist-open] LDAP realm bug
Thanks for your response. I adjusted my config slightly as follows.. and restarted exist, but got the same error message: "An LDAP URL must be specified of the form ldap://:" . I have tested the ldap url independently of eXist and the url does work. I tried a few variations of this but nothing seems to work... it's always the same message. If it is indeed a config error and not a bug, it would be useful to have a more meaningful error message.
<security-manager xmlns="http://exist-db.org/Configuration" last-account-id="12" last-group-id="14" version="2.0">
<authentication-entry-point>/authentication/login</authentication-entry-point>
<!--<events></events>-->
<realm id="LDAP" version="1.0" principals-are-case-insensitive="true">
<context>
<authentication>simple</authentication>
<use-ssl>false</use-ssl>
<url>ldap://ldap.mydomain.org:389</url>
<domain>mydomain.org</domain>
<search>
<base>DC=mydomain,DC=org</base>
<account>
<search-filter-prefix>objectClass=user</search-filter-prefix>
<search-attribute key="objectSid">objectSid</search-attribute>
<search-attribute key="primaryGroupID">primaryGroupID</search-attribute>
<search-attribute key="name">sAMAccountName</search-attribute>
<search-attribute key="dn">distinguishedName</search-attribute>
<search-attribute key="memberOf">memberOf</search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson/first">givenName</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/contact/email">mail</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson/last">sn</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson">name</metadata-search-attribute>
</account>
<group>
<search-filter-prefix>objectClass=group</search-filter-prefix>
<search-attribute key="member">member</search-attribute>
<search-attribute key="primaryGroupToken">primaryGroupToken</search-attribute>
<search-attribute key="objectSid">objectSid</search-attribute>
<search-attribute key="name">sAMAccountName</search-attribute>
<search-attribute key="dn">distinguishedName</search-attribute>
</group>
</search>
</context>
</realm>
</security-manager>
Thomas W. Ford
Assistant Director of Web Application Development Ext# 5-9731 ________________________________________
From: Misztur, Chris [***@macleanfogg.com]
Sent: Monday, July 07, 2014 8:36 AM
To: Ford, Thomas; Adam Retter
Cc: exist-***@lists.sourceforge.net
Subject: RE: [Exist-open] LDAP realm bug
In my domain users log in as such: domain\username However through exist they login as: ***@my-domain.com
Here is my config :
<security-manager xmlns="http://exist-db.org/Configuration" last-account-id="26" last-group-id="11" version="2.0">
<authentication-entry-point>/authentication/login</authentication-entry-point>
<realm id="LDAP" version="1.0" principals-are-case-insensitive="true">
<context>
<authentication>simple</authentication>
<use-ssl>false</use-ssl>
<!--<principal-pattern></principal-pattern>-->
<url>ldap://domain-controller.my-domain.com:389</url>
<domain>my-domain.com</domain>
<search>
<base>DC=my-domain,DC=com</base> <!--<default-username></default-username>-->
<!--<default-password></default-password>-->
<account>
<search-filter-prefix>objectClass=user</search-filter-prefix>
<search-attribute key="objectSid">objectSid</search-attribute>
<search-attribute key="primaryGroupID">primaryGroupID</search-attribute>
<search-attribute key="name">sAMAccountName</search-attribute>
<search-attribute key="dn">distinguishedName</search-attribute>
<search-attribute key="memberOf">memberOf</search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson/first">givenName</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/contact/email">mail</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson/last">sn</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson">name</metadata-search-attribute>
<!--<whitelist></whitelist>-->
<!--<blacklist></blacklist>-->
</account>
<group>
<search-filter-prefix>objectClass=group</search-filter-prefix>
<search-attribute key="member">member</search-attribute>
<search-attribute key="primaryGroupToken">primaryGroupToken</search-attribute>
<search-attribute key="objectSid">objectSid</search-attribute>
<search-attribute key="name">sAMAccountName</search-attribute>
<search-attribute key="dn">distinguishedName</search-attribute>
<!--<whitelist></whitelist>-->
<!--<blacklist></blacklist>-->
</group>
</search>
<!--<transformation></transformation>-->
</context>
</realm>
<!--<events></events>-->
</security-manager>
-----Original Message-----
From: Ford, Thomas [mailto:***@nflc.umd.edu]
Sent: Thursday, July 03, 2014 5:57 AM
To: Adam Retter
Cc: exist-***@lists.sourceforge.net
Subject: Re: [Exist-open] LDAP realm bug
Sorry that was incomplete. Here is a more complete representation of the markup in: /db/system/security/config.xml
-----
<security-manager xmlns="http://exist-db.org/Configuration" last-account-id="12" last-group-id="14" version="2.0">
<authentication-entry-point>/authentication/login</authentication-entry-point>
<!--<events></events>-->
<realm id="LDAP">
<context>
<authentication>simple</authentication>
<url>ldap://myldap.mydomain.org:389</url>
<domain>mydomain.org</domain>
<search>
<base>ou=MYORG People,dc=mydomain,dc=org</base>
<default-username>***@nflc.org</default-username>
<default-password>mypass</default-password>
<account>
<search-filter-prefix>objectClass=user</search-filter-prefix>
<search-attribute key="name">sAMAccountName</search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson/first">givenName</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/contact/email">mail</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson/last">sn</metadata-search-attribute>
<metadata-search-attribute key="http://axschema.org/namePerson">name</metadata-search-attribute>
</account>
<group>
<search-filter-prefix>objectClass=group</search-filter-prefix>
<search-attribute key="member">member</search-attribute>
<search-attribute key="primaryGroupToken">primaryGroupToken
</search-attribute>
<search-attribute key="objectSid">objectSid</search-attribute>
<search-attribute key="name">sAMAccountName</search-attribute>
<search-attribute key="dn">distinguishedName</search-attribute>
<whitelist>
<principal>Domain Users</principal>
</whitelist>
</group>
</search>
</context>
</realm>
</security-manager>
-----
Thomas W. Ford
Assistant Director of Web Application Development Ext# 5-9731 ________________________________
From: Adam Retter [***@exist-db.org]
Sent: Wednesday, July 02, 2014 10:22 AM
To: Ford, Thomas
Cc: exist-***@lists.sourceforge.net
Subject: Re: [Exist-open] LDAP realm bug
Your url element is inside your authentication element. Which it should not be, please check your xml against the example in the documentation again.
On 2 Jul 2014 15:18, "Ford, Thomas" <***@nflc.umd.edu<mailto:***@nflc.umd.edu>> wrote:
I am trying to migrate our eXist-db v1.4.3 system to the latest 2.1.6 LTS version. We very much need the LDAP feature to work but it does not appear to be working yet. I've followed the instructions here:
http://exist-db.org/exist/apps/doc/security.xml?q=security%20changes&field=all&id=D2.2.4#ldap-realm
.. modifying the url, domain, and base to match our Active Directory url, domain, and OU structure. I restarted, and the first error I got was: "An LDAP URL must be specified of the form ldap://:" . I saw that there was a post related to this here: http://exist.2174344.n4.nabble.com/Help-to-configure-LDAP-td4663342.html#a4663348
However, it did not offer any working solution and did not appear to have been resolved. I even found the Java class where this exception is thrown:
extensions/security/ldap/src/org/exist/security/realm/ldap/LdapContextFactory.java
----
if (url == null) {
throw new IllegalStateException("An LDAP URL must be specified of the form ldap://<hostname>:<port>"); }
----
However, I have defined the connection url exactly as described in the documentation. So, I am inclined to think this is a bug. Perhaps the value of the url element is not getting assigned to the property in the java class? Has anyone else got this working?
/db/system/security/config.xml
<security-manager>
...
<realm id="LDAP">
<authentication>
<url>ldap://myldap.domain.org:389<http://myldap.domain.org:389></url>
...
Please advise,
Thanks,
Tom
Thomas W. Ford
Assistant Director of Web Application Development National Foreign Language Center Univ. of Maryland, College Park, MD
The information contained in this e-mail message, including attachments, is confidential and/or privileged information and is intended only for the use of the person(s) or entity to which it is addressed. Unauthorized dissemination, distribution, or copying of this information is strictly prohibited. If you received this e-mail in error, please notify the sender and delete this message and any attachments.
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________
Exist-open mailing list
Exist-***@lists.sourceforge.net<mailto:Exist-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/exist-open
The information contained in this e-mail message, including attachments, is confidential and/or privileged information and is intended only for the use of the person(s) or entity to which it is addressed. Unauthorized dissemination, distribution, or copying of this information is strictly prohibited. If you received this e-mail in error, please notify the sender and delete this message and any attachments.
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________
Exist-open mailing list
Exist-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
________________________________
The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
Please consider the environment before printing this e-mail
The information contained in this e-mail message, including attachments, is confidential and/or privileged information and is intended only for the use of the person(s) or entity to which it is addressed. Unauthorized dissemination, distribution, or copying of this information is strictly prohibited. If you received this e-mail in error, please notify the sender and delete this message and any attachments.
________________________________
The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
Please consider the environment before printing this e-mail