Apache solr
doesn't implictly provide support for ldap authentication.
Provided BasicAuthPlugin.java
file enables the solr to work with ldap authentication as well.
Notes: these changes will enable ldap authentication along with basic authentication in solr. It doesn't disable basic authentication.
Steps to compile & configure solr are as followed:
-
Download the solr source code: https://github.com/apache/lucene-solr/tree/releases/lucene-solr/7.1.0
-
Unzip it & goto following path:
lucene-solr-releases-lucene-solr-7.1.0\solr\core\src\java\org\apache\solr\security\
-
Replace the
BasicAuthPlugin.java
file with provided one. -
Goto
lucene-solr-releases-lucene-solr-7.1.0\solr\core
directory & compile:$ ant compile
-
Once compilation is finished. Make jar:
$ ant dist
-
Updated jar file would be present inside:
lucene-solr-releases-lucene-solr-7.1.0\solr\build\solr-core\
- Enable basic authentication on solr. (follow solr guidelines)
- Add these 3 lines in security.json file below "blockUnknown":true, as shown:
"blockUnknown":true,
"ldapURL":"127.0.0.1:10389/",
"ldapBase":"o=sevenSeas",
"ldapObjectClass":"inetOrgPerson",
Note: replace with appropriate ldap server parameters.
-
update
security.json
file in solr (follow solr guidelines). -
Stop
solr
-
Upload the solr-core jar file created earlier to following path in solr setup:
/opt/solr/server/solr-webapp/webapp/WEB-INF/lib/
-
Replace the original jar with new one:
$ mv solr-core-7.1.0-SNAPSHOT.jar solr-core-7.1.0.jar
-
start solr
-
access the solr gui with ldap users. Voila.