Class X509UserDetailsService
java.lang.Object
com.irurueta.authserver.authorization.api.web.x509.X509UserDetailsService
- All Implemented Interfaces:
org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken>
public class X509UserDetailsService
extends Object
implements org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken>
Loads the account a client certificate is bound to. The principal of the pre-authenticated token is the fingerprint
the
CertificatePrincipalExtractor took, which ResolveCertificateLoginUseCase maps to the account;
the account is then loaded through a UserDetailsService that refuses a disabled, locked or expired one, as
the other sign-in methods do.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResolveCertificateLoginUseCaseFinds the account a certificate is bound to.private final org.springframework.security.core.userdetails.UserDetailsServiceLoads the account, refusing one that cannot sign in. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.userdetails.UserDetailsloadUserDetails(org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken token) Loads the account of a certificate.
-
Field Details
-
resolveCertificateLoginUseCase
Finds the account a certificate is bound to. -
userDetailsService
private final org.springframework.security.core.userdetails.UserDetailsService userDetailsServiceLoads the account, refusing one that cannot sign in.
-
-
Constructor Details
-
X509UserDetailsService
public X509UserDetailsService()
-
-
Method Details
-
loadUserDetails
public org.springframework.security.core.userdetails.UserDetails loadUserDetails(org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken token) throws org.springframework.security.core.userdetails.UsernameNotFoundException Loads the account of a certificate.- Specified by:
loadUserDetailsin interfaceorg.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken>- Parameters:
token- the token whose principal is the fingerprint of the certificate.- Returns:
- the account.
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException- if the certificate is not bound to any account.org.springframework.security.authentication.AccountStatusException- if the account cannot sign in.
-