Hi everyone,
I have an application that uses a ClentLoginModule on the client-side and the DatabaseServerLoginModule on the server-side. I have a class called Authenticate that does the login. The code is as follows:
____________________________________________
public boolean authenticated(String user, String pass) throws Exception
{
boolean login = false;
char[] password = pass.toCharArray();
try
{ System.setProperty("java.security.auth.login.config","file://C:/projects/0341_ardec_ebf/lib/jboss/client/auth.conf");
AppCallbackHandler handler = new AppCallbackHandler(user, password);
LoginContext lc = new LoginContext("other",handler);
System.out.println("Created LoginContext");
lc.login();
login=true;
}
catch (LoginException le)
{
System.out.println("Login failed");
login=false;
le.printStackTrace();
}
return login;
}
________________________________________________
(For test purposes)When a simple client class calls the above mentioned Authenticate class method, the login takes place perfectly and everything works fine.
However, in the application I have created, the client is a servlet(required) that calls the above mentioned class method to authenticate. However, I get the following messages:
-----------------------------------------------
[EmbeddedTomcatSX] Login failed
[EmbeddedTomcatSX] javax.security.auth.login.LoginException: No LoginModules con
figured for other
[EmbeddedTomcatSX] at javax.security.auth.login.LoginContext.init(LoginCont
ext.java:176)
------------------------------------------------
I know this is happening because when the "LoginContext lc = new LoginContext("other",handler);" is called, it searches for "other" in the jboss.home/conf/tomcat/auth.conf file instead of jboss.home/client/auth.conf file.
Does anyone know how I can fix this error? Please help!!!
Thanks,
Deepa George