Exception thrown whil using CustomLoginModule
juserp Aug 11, 2005 10:20 AMI programmed a custom login module for JBoss (it extends org.jboss.security.auth.spi.AbstractServerLoginModule) and defined in login-config.xml:
<application-policy name = "jmx-consoletest">
<login-module code = ".my.sso.OSSOLoginModule"
flag = "required">
</login-module>
</application-policy>
the flow here is:
I have valve:
1. reads REMOTE_USER
2. OSSOUsernameHandler handler = new OSSOUsernameHandler(remoteAttr);
LoginContext lc = new LoginContext("jmx-consoletest", handler);
lc.login();
Subject subject = lc.getSubject();
Callbackhandler sets the remoteattr on NAmecallback.
And login module sets this as identity and some test roles.
Am stuck at this point.Pls guide what could be going wrong in this case.
I made a jar file (test-auth.jar) with my.sso.* classes, all loginmodule, callbackhandler and vale exist int his package and put it in /server/default/lib (this is the server config I?m running).
Then I start up JBoss and deploy an app which uses that security domain, but when I try to access it I get:
18:57:30,850 ERROR [CoyoteAdapter] An exception or error occurred in the container during the request processing
java.util.MissingResourceException: Can't find resource for bundle sun.security.util.Resources, key unable to instantiate LoginModule:
at java.util.ResourceBundle.getObject(ResourceBundle.java:314)
at java.util.ResourceBundle.getString(ResourceBundle.java:274)
at sun.security.util.ResourcesMgr.getString(ResourcesMgr.java:36)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:707)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
at my.sso.MyValve.invoke(MyValve.java:65)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:536)