public class DefaultUserLockoutService extends Object implements UserLockoutService
| Constructor and Description |
|---|
DefaultUserLockoutService(UserService<User> userService,
UserLoginAttemptService<UserLoginAttempt> userLoginAttemptService,
AuthorizedClientService<AuthorizedClient> clientService,
AuthorizationServerService<AuthorizationServer> serverService,
UserLockoutProperties userLockoutProperties) |
public DefaultUserLockoutService(UserService<User> userService, UserLoginAttemptService<UserLoginAttempt> userLoginAttemptService, AuthorizedClientService<AuthorizedClient> clientService, AuthorizationServerService<AuthorizationServer> serverService, UserLockoutProperties userLockoutProperties)
public void createLoginAttempt(User user, String loginAttemptResult)
UserLockoutServicecreateLoginAttempt in interface UserLockoutServiceuser - The user to create a login attempt forloginAttemptResult - The login attempt result.public void createLoginAttempt(String username, String loginAttemptResult, String clientId)
UserLockoutServicecreateLoginAttempt in interface UserLockoutServiceusername - The username to create an attempt forloginAttemptResult - The login attempt resultclientId - The client IDpublic User unlockUser(User user)
UserLockoutServiceunlockUser in interface UserLockoutServiceuser - The user to unlockpublic User lockUser(User user)
UserLockoutServicelockUser in interface UserLockoutServiceuser - The user to lockpublic Optional<User> unlockUserIfEligible(String username, String clientId)
UserLockoutServiceunlockUserIfEligible in interface UserLockoutServiceusername - The usernameclientId - The client IDpublic boolean canResetPassword(User user)
UserLockoutService
See AuthorizationServer.getLockedUserCanResetPassword() and
UserLockoutProperties.isLockedUserCanResetPassword()
canResetPassword in interface UserLockoutServiceuser - The user to check@Nullable public Boolean unlockUserOnPasswordResetIfEligible(User user)
UserLockoutService
See AuthorizationServer.getResetPasswordUnlocksUser() and
UserLockoutProperties.isResetPasswordUnlocksUser()
unlockUserOnPasswordResetIfEligible in interface UserLockoutServiceuser - The user to unlock, if eligibleprotected void createLoginAttempt(String username, @Nullable String userId, String loginAttemptResult, String authServerId)
protected boolean userShouldBeUnlocked(@Nullable
User user,
AuthorizationServer server)
protected int countLoginAttempts(String username, AuthorizationServer server)
@Nullable protected Duration getLockoutDuration(AuthorizationServer server)
protected AuthorizationServer readAuthServer(String authServerId)
@Nullable protected Long getLockoutDurationMinutes(AuthorizationServer server)
@Nullable protected Long getLoginFailDecayMinutes(AuthorizationServer server)
protected int getLoginAttemptsAllowed(AuthorizationServer server)
protected void throwIfLocked(int attempts,
String username,
AuthorizationServer server,
@Nullable
User user)
protected boolean isResetPasswordUnlocksUser(AuthorizationServer server)
protected boolean isLockedUserCanResetPassword(AuthorizationServer server)
protected UserService<User> getUserService()
protected UserLoginAttemptService<UserLoginAttempt> getUserLoginAttemptService()
protected AuthorizedClientService<AuthorizedClient> getClientService()
protected AuthorizationServerService<AuthorizationServer> getServerService()
protected UserLockoutProperties getUserLockoutProperties()
Copyright © 2021. All rights reserved.