I have one URL accessible through a servlet that I blocked with Spring Security DaoAuthenticationProvider. Now I have a requirement that certain incoming IP addresses are whitelisted and therefore not requested for authentication.
I can easily crack this by overriding the authentication method of DaoAuthenticationProvider and bypassing the implementation of superclasses if the IP address matches a known IP address, but this only works when the sender of the request provides username and password (even if it's nonsense). Otherwise, the provider will not be called.
What would be the best way to do this? Should I use a filter to bypass the authentication procedure if the incoming known IP address?
source
share