No AuthenticationProvider found for UsernamePasswordAuthenticationToken
As you already wrote in your comment the problem is that you always return false
in the supports()
method of your autentication provider. But instead of always returning true
you should check the authentication
you get like this:
public class MyAuthenticationProvider implements AuthenticationProvider, Serializable {
@Override
public boolean supports(Class<? extends Object> authentication) {
return (UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication));
}
// ...
}
I had the same issue. In my case the solution was to set AbstractAuthenticationToken.setAuthenticated to true after the authentication passed.