Class AccountStatusUserDetailsService
java.lang.Object
com.irurueta.authserver.authorization.api.web.passkeys.AccountStatusUserDetailsService
- All Implemented Interfaces:
org.springframework.security.core.userdetails.UserDetailsService
public class AccountStatusUserDetailsService
extends Object
implements org.springframework.security.core.userdetails.UserDetailsService
A
UserDetailsService that refuses a disabled, locked or expired account.
Spring's WebAuthn provider loads the user a verified passkey belongs to and trusts it: unlike the password
provider (see PasswordAuthenticationConfiguration) it never checks the status of the account. Handing it
this decorator makes the passkey sign-in refuse the accounts the password sign-in refuses. The provider turns any
exception into a bad-credentials failure, so the page shows the generic message.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.userdetails.UserDetailsloadUserByUsername(String username) Loads an account that may sign in.
-
Field Details
-
delegate
private final org.springframework.security.core.userdetails.UserDetailsService delegateService that loads the account. -
checker
private final org.springframework.security.core.userdetails.UserDetailsChecker checkerChecker of the status of the account.
-
-
Constructor Details
-
AccountStatusUserDetailsService
public AccountStatusUserDetailsService()
-
-
Method Details
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException Loads an account that may sign in.- Specified by:
loadUserByUsernamein interfaceorg.springframework.security.core.userdetails.UserDetailsService- Parameters:
username- name of the user.- Returns:
- the account.
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException- if there is no such account.org.springframework.security.authentication.AccountStatusException- if the account is disabled, locked or expired.
-