I am migrating from JBoss AS to WLS 11g. We had our custom login module in JBoss so I am creating a custom authentication provider in WLS. The custom provider should retrieve the request object in order to get a certain HTTP header from it. In JBoss it's pretty straightforward as i could get it using PolicyContext.getContext("javax.servlet.http.HttpServletRequest").
I tried the same code in WLS but it did not work. Anyone has a clue how to do this?
Okay i got the answer myself. I created a new callback of type ContextHandlerCallback. then using the normal javax.security.auth.callback.CallbackHandler.handle(callbacks) methods, the callback is populated with the Context. The request can then be retrieved using the lines:
ContextHandler handler = ch.getContextHandler();
HttpServletRequest request = (HttpServletRequest) handler.getValue("com.bea.contextelement.servlet.HttpServletRequest");