You may still run into issues, especially if you want to make you login modules independant of the bundles using those. Karaf allows that and also allow deployment of configurations through the OSGi registry. See http://felix.apache.org/site/45-security-framework.html
On Mon, May 11, 2009 at 19:15, derekv <[email protected]> wrote: > > > 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] > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

