You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2012/09/04 18:50:07 UTC

[jira] [Resolved] (OAK-256) JAAS Authentication failing in OSGi env due to classloading issue

     [ https://issues.apache.org/jira/browse/OAK-256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved OAK-256.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 0.5
         Assignee: Jukka Zitting

Fixing this in LoginContextProviderImpl is a bit troublesome, as in non-OSGi environments a configured LoginModule could well come from outside the oak-core class loader.

Therefore I adjusted the patch a bit to only force the thread context class loader when a login() call when running inside an OSGi environment. See revision 1380738 for details.
                
> JAAS Authentication failing in OSGi env due to classloading issue
> -----------------------------------------------------------------
>
>                 Key: OAK-256
>                 URL: https://issues.apache.org/jira/browse/OAK-256
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>    Affects Versions: 0.5
>            Reporter: Chetan Mehrotra
>            Assignee: Jukka Zitting
>              Labels: osgi, sling
>             Fix For: 0.5
>
>         Attachments: OAK-256-tccl-switch.patch
>
>
> At times Repository login fails because the LoginModule cannot be instantiated 
> {noformat}
> Caused by: javax.jcr.LoginException: unable to find LoginModule class: org.apache.jackrabbit.oak.security.authentication.LoginModuleImpl
> 	at org.apache.jackrabbit.oak.jcr.RepositoryImpl.login(RepositoryImpl.java:139)
> 	at org.apache.jackrabbit.oak.jcr.SessionImpl.impersonate(SessionImpl.java:114)
> 	at org.apache.sling.jcr.base.SessionProxyHandler$SessionProxyInvocationHandler.invoke(SessionProxyHandler.java:101)
> 	at $Proxy9.impersonate(Unknown Source)
> 	at org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet$1.getLongLivedSession(SlingDavExServlet.java:206)
> {noformat}
> As a fix LoginContextProviderImpl should switch the Thread's context classloader (TCCL) to oak-jcr bundle's classloader so that required loginmodule class can be instantiated

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira