Hi,

I just picked up my effort to use (a trimmed down flavor of) Sling Starter
to deploy Oak *only*.
I'm running into this issue when code tries to log into the JCR repository:

> javax.security.auth.login.LoginException: No LoginModule found for
> org.apache.felix.jaas.boot.ProxyLoginModule
>     at java.base/javax.security.auth.login.LoginContext.invoke(Unknown
> Source)
>     at java.base/javax.security.auth.login.LoginContext$4.run(Unknown
> Source)
>     at java.base/javax.security.auth.login.LoginContext$4.run(Unknown
> Source)
>     at java.base/java.security.AccessController.doPrivileged(Unknown
> Source)
>     at java.base/javax.security.auth.login.LoginContext.invokePriv(Unknown
> Source)
>     at java.base/javax.security.auth.login.LoginContext.login(Unknown
> Source)
>     at
> org.apache.jackrabbit.oak.core.ContentRepositoryImpl.login(ContentRepositoryImpl.java:163)
>     at
> org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:294)
>     ... 47 more
>

In the JAAS panel of the Felix Web Console, I see:

> JAAS Configuration Details:
>
> Registered LoginModules
> Realm : jackrabbit.oak
>   org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule
>     Flag    : OPTIONAL
>     Type    : Configuration
>     Ranking : 300
>   org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule
>     Flag    : SUFFICIENT
>     Type    : Configuration
>     Ranking : 200
>   org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl
>     Flag    : REQUIRED
>     Type    : Configuration
>     Ranking : 100
>
> Available LoginModules
> org.apache.jackrabbit.oak-core (105)
>   org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule
>   org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl
>   org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule
>

My understanding is that this *ProxyLoginModule* is a special module, used
to "bootstrap" the JAAS setup in an OSGi environment.
Speaking of JAAS, I do have this bundle installed in my setup by the way:

        {
>             "id":"org.apache.felix:org.apache.felix.jaas:1.0.2",
>             "start-order": "10"
>         },
>

And, for the record, those are the relevant configuration items, I think:

    "org.apache.felix.jaas.Configuration.factory~GuestLoginModule": {
>       "jaas.controlFlag": "optional",
>       "jaas.classname":
> "org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule",
>       "jaas.ranking": 300
>     },
>     "org.apache.felix.jaas.Configuration.factory~TokenLoginModule": {
>       "jaas.controlFlag": "sufficient",
>       "jaas.classname":
> "org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule",
>       "jaas.ranking": 200
>     },
>     "org.apache.felix.jaas.Configuration.factory~LoginModuleImpl": {
>       "jaas.controlFlag": "required",
>       "jaas.classname":
> "org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl",
>       "jaas.ranking": 100
>     },
>     "org.apache.felix.jaas.ConfigurationSpi": {
>       "jaas.configProviderName": "FelixJaasProvider",
>       "jaas.defaultRealmName": "jackrabbit.oak",
>       "jaas.globalConfigPolicy": "replace"
>     },
>

So, what could be the cause of this problem?
And how can I fix it?
Thanks a lot!

Regards,

On Fri, Aug 5, 2022 at 8:43 PM Damiano Albani <damiano.alb...@gmail.com>
wrote:

> Hello Robert,
>
> Thanks, that's indeed what I ended up doing.
> With mostly positive results so far.
> Yet, Karaf is very much new to me, so I'm still trying to find my way
> through it.
>
> Regards,
>
> On Thu, Aug 4, 2022 at 2:40 PM Robert Munteanu <romb...@apache.org> wrote:
>
>> Hi Damiano,
>>
>> On Thu, 2022-07-28 at 22:44 +0200, Damiano Albani wrote:
>> > Hello,
>> >
>> > I've been using Oak for some time now, in a custom Spring Boot based
>> > application.
>> > Basically like what's suggested in
>> >
>> https://github.com/apache/jackrabbit-oak/tree/trunk/oak-examples/standalone
>> > .
>> > Yet, I'd like to be able to make use of more "advanced" OSGi features
>> > like
>> > dynamic bundle management.
>> > But from what I could see/test, that's not what PojoSR supports.
>> > Thus the need to run Oak in a proper, "full blown" OSGi environment.
>> >
>> > I saw that Sling provides a Karaf distribution:
>> > https://sling.apache.org/documentation/karaf.html.
>> > Given that Sling uses Oak, I suppose that it's possible to run Oak
>> > only on
>> > Karaf.
>> > But I couldn't find any ready-made recipe or instructions to do so.
>> > So has anyone already tried to run Oak on Karaf? If so, could you
>> > share
>> > your work?
>> > Or, alternatively, would there be another OSGi platform that you
>> > would
>> > recommend?
>>
>> You can try the Sling Karaf Features [1] or the Sling Starter [2] and
>> progressively remove the parts that you don't want/need.
>>
>> Thanks,
>> Robert
>>
>> [1]: https://sling.apache.org/documentation/karaf.html
>> [2]: https://github.com/apache/sling-org-apache-sling-starter
>>
>> >
>> > Thanks for your help!
>> >
>> > Regards,
>> >
>>
>>
>
> --
> Damiano Albani
>


-- 
Damiano Albani

Reply via email to