Class HaveIBeenPwnedRestApiPasswordChecker
java.lang.Object
org.springframework.security.web.authentication.password.HaveIBeenPwnedRestApiPasswordChecker
- All Implemented Interfaces:
org.springframework.security.authentication.password.CompromisedPasswordChecker
public final class HaveIBeenPwnedRestApiPasswordChecker
extends Object
implements org.springframework.security.authentication.password.CompromisedPasswordChecker
Checks if the provided password was leaked by relying on
Have I Been Pwned REST
API. This implementation uses the Search by Range in order to protect the value of
the source password being searched for.
- Since:
- 6.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.password.CompromisedPasswordDecisionvoidsetRestClient(org.springframework.web.client.RestClient restClient) Sets theRestClientto use when making requests to Have I Been Pwned REST API.
-
Constructor Details
-
HaveIBeenPwnedRestApiPasswordChecker
public HaveIBeenPwnedRestApiPasswordChecker()
-
-
Method Details
-
check
@NonNull public org.springframework.security.authentication.password.CompromisedPasswordDecision check(String password) - Specified by:
checkin interfaceorg.springframework.security.authentication.password.CompromisedPasswordChecker
-
setRestClient
public void setRestClient(org.springframework.web.client.RestClient restClient) Sets theRestClientto use when making requests to Have I Been Pwned REST API. By default, aRestClientwith a base URL ofAPI_URLis used.- Parameters:
restClient- theRestClientto use
-