-
1. Re: JBoss AS 7.1 custom login module - obtain client IP address
urug May 18, 2012 1:13 AM (in response to urug)Solved this by using a Catalina custom authenticator for Basic/Form and other types of authentication - overrode the authenticate method to set a ThreadLocal context that other components use further up the chain.
https://community.jboss.org/wiki/DRAFTUsingJBossNegotiationOnAS7
public class MyAuthenticator extends org.apache.catalina.authenticator.BasicAuthenticator
{
....
@Override
public boolean authenticate(Request request, HttpServletResponse response, LoginConfig config) throws IOException
{
MyServletContext.setContext(request, response); // Servlet context stores ThreadLocal request/response for others to query/retrieve
try
{
return super.authenticate(request, response, config);
}
finally
{
MyServletContext.removeContext();
}
}
....
}
Message was edited by: Guru Somadder