@Component class SpringSecurityAuthenticationManager extends Object implements AuthenticationManager
AuthenticationManager
using the current SpringSecurity Authentication
to lookup a UserAccount
by the identifier of it.Constructor and Description |
---|
SpringSecurityAuthenticationManager(UserAccountRepository repository,
org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) |
Modifier and Type | Method and Description |
---|---|
Optional<UserAccount> |
getCurrentUser()
Returns the
UserAccount of the currently logged in user or Optional.empty() if no-one is currently
logged in. |
boolean |
matches(Password candidate,
Password existing)
Returns whether the given candidate
Password matches the given existing one. |
@ConstructorProperties(value={"repository","passwordEncoder"}) @Generated(value="lombok") public SpringSecurityAuthenticationManager(@NonNull UserAccountRepository repository, @NonNull org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
public Optional<UserAccount> getCurrentUser()
AuthenticationManager
UserAccount
of the currently logged in user or Optional.empty()
if no-one is currently
logged in.getCurrentUser
in interface AuthenticationManager
public boolean matches(Password candidate, Password existing)
AuthenticationManager
Password
matches the given existing one.matches
in interface AuthenticationManager
candidate
- can be null.existing
- must not be null.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.