gnodet wrote:
>
> Have you had a look at the jaas stuff in Karaf:
> https://svn.apache.org/repos/asf/felix/trunk/karaf/jaas
>
> You can deploy JAAS configuration dynamically without any change on
> the client side.
>
I found this bit of code that seems to get the trick done for me.
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
LoginContext lc = new LoginContext("AppName", new
MyCallbackHandler());
lc.login();
}
finally {
Thread.currentThread().setContextClassLoader(ccl);
}
This way, when the LoginContext.login() method is called and it does its
Class.forName() it can get the loginModuleClass that i have setup for that
appName, because the classloader has acess to the classes i have in that
bundle. Not sure if this is the best/good way to do this or not.....
--
View this message in context:
http://www.nabble.com/osgi-and-jaas-tp23485885p23487286.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]