Package org.flasby.security
Class IpAddressAuthProvider
- java.lang.Object
-
- org.flasby.security.IpAddressAuthProvider
-
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
@Component public class IpAddressAuthProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IpAddressAuthProvider.BannedIpAddressException
annoyingly, the Spring Auth Manager keeps iterating through its list of Auth Providers if one throws an exception unless it's a subclass of AccountStatusException.
-
Constructor Summary
Constructors Constructor Description IpAddressAuthProvider(BannedIpRepository bannedIpRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.Authentication
authenticate(org.springframework.security.core.Authentication authentication)
Invokes the IP Block checksboolean
supports(Class<?> authentication)
-
-
-
Constructor Detail
-
IpAddressAuthProvider
public IpAddressAuthProvider(@Autowired BannedIpRepository bannedIpRepository)
-
-
Method Detail
-
supports
public boolean supports(Class<?> authentication)
- Specified by:
supports
in interfaceorg.springframework.security.authentication.AuthenticationProvider
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
Invokes the IP Block checks- Specified by:
authenticate
in interfaceorg.springframework.security.authentication.AuthenticationProvider
- Throws:
org.springframework.security.core.AuthenticationException
-
-