I am using Servicemix 4.2 for my osgi based webservice application. My webservice application is exposed using the CXF stack provided with the Servicemix.
Now we have to integrate the application with a separately developed Authentication api. The third party api is using JAAS as the mean to authenticate.
I embedded the third party jars in my application bundle. I exported the LoginModule implementation class using export-package instruction.
When I tried to use the third party provided jaas module, it gave error Cannot create Login Context.No LoginModules configured for LoginModule
The third party jaas provider finds the location of jaas.config file using the system property java.security.auth.login.config The content of jaas.config file is as follows
LoginModule { com.altair.aaservice.windowsauthn.hwec.WindowsAuthentication required; };
After doing googling, I found that s开发者_StackOverflow中文版ervicemix out of box provides two System bundles for jaas Apache Felix Karaf :: JAAS Modules (1.4.0) Apache Felix Karaf :: JAAS Config (1.4.0)
And you need to modify etc/users.properties file and some other things to implement jaas. But as we need to integrate with a third party jaas provider, i can not look into these ways. Also most of the documentation provided with servicemix insist you to use the servicemix way to implement jaas hence I did not get much success in finding any solution.
I manually uninstalled the two system bundles, after that I got following error javax.security.auth.login.LoginException: unable to find LoginModule class: com.altair.aaservice.windowsauthn.hwec.WindowsAuthentication not found from bundle [org.apache.cxf.bundle]
As my webservice is CXF based, it may be looking in this bundle.
Is there any convenient way to integrate servicemix with custom jaas implementation. Please tell if there is any.
There is an example of writing a custom JAAS LoginModule here.
精彩评论