Thanks so much for the help!
I have a few more questions. Nothing was happening when I first tried this, so I started to debug and found that the...
Code:
String header = httpRequest.getHeader("Authorization");
...in the BasicProcessingFilter.doFilter() method was null, because the "Authorization" header was not in the header. So I extended BasicProcessingFilter.doFilter(), just to see if I could get something to work for me.
Code:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
ServletException {
// Call the parent's doFilter()
super.doFilter(request, response, chain);
HttpServletRequest httpRequest = (HttpServletRequest) request;
String header = httpRequest.getHeader("Authorization");
log.info("Authorization header: " + header);
if (header == null) {
log.info("Header was null... calling EntryPoint.commence()");
super.getAuthenticationEntryPoint().commence(request, response);
}
}
All I did was call commence on the entry point if the "Authorization" header value was null. This seemed to work. So now I'm wondering why the server didn't put the "Authorization" header in there in the first place? I'm sure I'm missing something.
Also, what is the typical stratagy for logging a user off?
Thanks :!: