Hello,
I had the same problem and came across this thread. So just for the records I post my solution.
I extended AnonymousProcessingFilter and overwrote the createAuthentication method:
Code:
@Override
protected Authentication createAuthentication(ServletRequest request) {
UserDetails userDetails = buildDetails(request);
AnonymousAuthenticationToken auth = new AnonymousAuthenticationToken(getKey(), userDetails, getUserAttribute().getAuthorities());
// auth.setDetails(authenticationDetailsSource.buildDetails((HttpServletRequest) request));
return auth;
}
You just have to provide a buildDetails method.
Maybe this would be a good extension point for the next version ?
Also the authenticationDetailsSource should get a getter method. I just have commented it, because I don't need it.
Can someone please reply if this is a good idea ?
Should I make a jira entry ?
Thanks.