Uploaded image for project: 'ManifoldCF'
  1. ManifoldCF
  2. CONNECTORS-1286

Solr Plugin: Add support for User Principal

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • ManifoldCF 2.3
    • ManifoldCF next
    • Solr 6.x component
    • None

    Description

      I’m using ManifoldCF 2.3 with Solr 5.4.1 and the Velocity templating engine. I needed to do searches with ACLs enabled and installed the plugin. Unfortunately it is not possible to use the login information provided by Jetty in the Solr plugin.

      As of Solr 5.3 it is possible to extract the authenticated user from the SolrQueryRequest object: http://lucene.apache.org/solr/5_3_0/solr-core/org/apache/solr/request/SolrQueryRequest.html#getUserPrincipal(). I added these lines to the code in org.apache.solr.mcf.ManifoldCFSearchComponent before the evaluation of parameters for authenticated user name:

          String authDomain = (String)args.get("AuthDomain");
      
          if (rb.req.getUserPrincipal() != null) {
                      domainMap.put("", rb.req.getUserPrincipal().getName() + ((authDomain == null) ? "" : "@" + authDomain));
          }
          else {
            // Get the authenticated user name from the parameters
      

      I also needed an additional setting “authDomain” in the search component configuration (solrconfig.xml). Now I can use Velocity even for documents with ACLs :o)

      Attachments

        Activity

          People

            kwright@metacarta.com Karl Wright
            konrad.holl Konrad Holl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: