JWT Auth plugin (https://github.com/cominvent/solr-auth-jwt) for Solr 7.2 Errors

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

JWT Auth plugin (https://github.com/cominvent/solr-auth-jwt) for Solr 7.2 Errors

Tyrone Tse
I am testing the JWT Auth plugin from
https://github.com/cominvent/solr-auth-jwt
as my project is using Solr 7.2.

I downloaded the master branch for the code, and I built the

jwt-auth-1.0.0.jar
with the mvn package command.

I then copied the jar to my $SOLR_HOME/lib/

I also downloaded the jose4j-0.6.3.jar
<https://bitbucket.org/b_c/jose4j/downloads/jose4j-0.6.3.jar> and
copied this to $SOLR_HOME/lib/
I created the following security.json file in $SOLR_HOME/server/solr

{
  "authentication": {
    "class":"com.cominvent.solr.JWTAuthPlugin",
        "jwk" : {
                "kty": "oct",
                "use": "sig",
                "kid": "solr",
                "k":
"pIpVnjhuAj9DBg8e2lwya7o_uZMM3Wqo2eK0uchOza0vBS-orZNYTkLcHTLXF9JaCBR08tWfFEWVPENF6sXKuaj8Mn65Kc3QUmS-csblVvjj69dXk2Mi-Zs2iDDM3QyyvdiyRpfxE-xKwwjhU47xs7M0Dq69I1UE5nrFkczLf9qe3b47ha3eBQDm1_zg8EVwxadJ7gfQ97jn2MtT6hHrts9YD6_Z_heAdYC2QYjBBIdEXzZgHSKqmPNNhDvAChF9AfmNiUlfAG_g0jMMLKYEUv6ck3KJA6A1JBq1iEstjvF7hchFgdgyVRCR5P8UM6n6Hb0YrHjjANyEYIZD9mFfBQ",
                "alg": "HS256"
                }
  }
}

When I start solr, I am seeing a 503 error when I go to
http://localhost:8983/solr/

HTTP ERROR 503

Problem accessing /solr/. Reason:
Service Unavailable

When I check the solr.log file I am seeing the following error

2019-09-13 15:09:27.816 ERROR (main) [   ] o.a.s.s.SolrDispatchFilter Could
not start Solr. Check solr/home property and the logs
2019-09-13 15:09:27.838 ERROR (main) [   ] o.a.s.c.SolrCore
null:java.lang.NoClassDefFoundError:
org/apache/solr/security/HttpClientBuilderPlugin
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Reply | Threaded
Open this post in threaded view
|

Re: JWT Auth plugin (https://github.com/cominvent/solr-auth-jwt) for Solr 7.2 Errors

Shawn Heisey-2
On 9/13/2019 10:30 AM, Tyrone Tse wrote:
> When I check the solr.log file I am seeing the following error
>
> 2019-09-13 15:09:27.816 ERROR (main) [   ] o.a.s.s.SolrDispatchFilter Could
> not start Solr. Check solr/home property and the logs
> 2019-09-13 15:09:27.838 ERROR (main) [   ] o.a.s.c.SolrCore
> null:java.lang.NoClassDefFoundError:
> org/apache/solr/security/HttpClientBuilderPlugin

That class should be in the solr-core jar.  It was added in Solr 7.0,
didn't exist before that.

The error is particularly strange because the SolrCore class which
logged the message is itself located in the solr-core jar.

This problem can be caused by having multiple copies of the same jar,
even the same version, in different places on the classpath.  Only add
extra jars to places like $SOLR_HOME/lib ... do not include jars for
Solr itself there.

Thanks,
Shawn
Reply | Threaded
Open this post in threaded view
|

Re: JWT Auth plugin (https://github.com/cominvent/solr-auth-jwt) for Solr 7.2 Errors

Tyrone Tse
I only copied the 2 jars

   -

   jwt-auth-1.0.0.jar

   -

   jose4j-0.6.3.jar


to the $SOLR_HOME/lib folder, to install the code for the
https://github.com/cominvent/solr-auth-jwt plugin

On Fri, Sep 13, 2019 at 11:55 AM Shawn Heisey <[hidden email]> wrote:

> On 9/13/2019 10:30 AM, Tyrone Tse wrote:
> > When I check the solr.log file I am seeing the following error
> >
> > 2019-09-13 15:09:27.816 ERROR (main) [   ] o.a.s.s.SolrDispatchFilter
> Could
> > not start Solr. Check solr/home property and the logs
> > 2019-09-13 15:09:27.838 ERROR (main) [   ] o.a.s.c.SolrCore
> > null:java.lang.NoClassDefFoundError:
> > org/apache/solr/security/HttpClientBuilderPlugin
>
> That class should be in the solr-core jar.  It was added in Solr 7.0,
> didn't exist before that.
>
> The error is particularly strange because the SolrCore class which
> logged the message is itself located in the solr-core jar.
>
> This problem can be caused by having multiple copies of the same jar,
> even the same version, in different places on the classpath.  Only add
> extra jars to places like $SOLR_HOME/lib ... do not include jars for
> Solr itself there.
>
> Thanks,
> Shawn
>
Reply | Threaded
Open this post in threaded view
|

Re: JWT Auth plugin (https://github.com/cominvent/solr-auth-jwt) for Solr 7.2 Errors

Jan Høydahl / Cominvent
JWT auth is not backported to 7.x and also requires changes to other core parts of Solr. So just dropping in the jars will not work.

I’d encourage you to upgrade to 8.x

Jan Høydahl

> 13. sep. 2019 kl. 19:54 skrev Tyrone Tse <[hidden email]>:
>
> I only copied the 2 jars
>
>   -
>
>   jwt-auth-1.0.0.jar
>
>   -
>
>   jose4j-0.6.3.jar
>
>
> to the $SOLR_HOME/lib folder, to install the code for the
> https://github.com/cominvent/solr-auth-jwt plugin
>
>> On Fri, Sep 13, 2019 at 11:55 AM Shawn Heisey <[hidden email]> wrote:
>>
>>> On 9/13/2019 10:30 AM, Tyrone Tse wrote:
>>> When I check the solr.log file I am seeing the following error
>>>
>>> 2019-09-13 15:09:27.816 ERROR (main) [   ] o.a.s.s.SolrDispatchFilter
>> Could
>>> not start Solr. Check solr/home property and the logs
>>> 2019-09-13 15:09:27.838 ERROR (main) [   ] o.a.s.c.SolrCore
>>> null:java.lang.NoClassDefFoundError:
>>> org/apache/solr/security/HttpClientBuilderPlugin
>>
>> That class should be in the solr-core jar.  It was added in Solr 7.0,
>> didn't exist before that.
>>
>> The error is particularly strange because the SolrCore class which
>> logged the message is itself located in the solr-core jar.
>>
>> This problem can be caused by having multiple copies of the same jar,
>> even the same version, in different places on the classpath.  Only add
>> extra jars to places like $SOLR_HOME/lib ... do not include jars for
>> Solr itself there.
>>
>> Thanks,
>> Shawn
>>
Reply | Threaded
Open this post in threaded view
|

Re: JWT Auth plugin (https://github.com/cominvent/solr-auth-jwt) for Solr 7.2 Errors

Tyrone
Jan

Thanks for your help, I’m going recommend to my team to upgrade, we’re not in production yet so it shouldn’t be an issue.

Sent from my iPhone

> On Sep 14, 2019, at 9:00 AM, Jan Høydahl <[hidden email]> wrote:
>
> JWT auth is not backported to 7.x and also requires changes to other core parts of Solr. So just dropping in the jars will not work.
>
> I’d encourage you to upgrade to 8.x
>
> Jan Høydahl
>
>> 13. sep. 2019 kl. 19:54 skrev Tyrone Tse <[hidden email]>:
>>
>> I only copied the 2 jars
>>
>>  -
>>
>>  jwt-auth-1.0.0.jar
>>
>>  -
>>
>>  jose4j-0.6.3.jar
>>
>>
>> to the $SOLR_HOME/lib folder, to install the code for the
>> https://github.com/cominvent/solr-auth-jwt plugin
>>
>>>> On Fri, Sep 13, 2019 at 11:55 AM Shawn Heisey <[hidden email]> wrote:
>>>>
>>>> On 9/13/2019 10:30 AM, Tyrone Tse wrote:
>>>> When I check the solr.log file I am seeing the following error
>>>>
>>>> 2019-09-13 15:09:27.816 ERROR (main) [   ] o.a.s.s.SolrDispatchFilter
>>> Could
>>>> not start Solr. Check solr/home property and the logs
>>>> 2019-09-13 15:09:27.838 ERROR (main) [   ] o.a.s.c.SolrCore
>>>> null:java.lang.NoClassDefFoundError:
>>>> org/apache/solr/security/HttpClientBuilderPlugin
>>>
>>> That class should be in the solr-core jar.  It was added in Solr 7.0,
>>> didn't exist before that.
>>>
>>> The error is particularly strange because the SolrCore class which
>>> logged the message is itself located in the solr-core jar.
>>>
>>> This problem can be caused by having multiple copies of the same jar,
>>> even the same version, in different places on the classpath.  Only add
>>> extra jars to places like $SOLR_HOME/lib ... do not include jars for
>>> Solr itself there.
>>>
>>> Thanks,
>>> Shawn
>>>