Package ru.pfr.common.biud.security.auth
Class BiudAuthenticationProvider
java.lang.Object
ru.pfr.common.biud.security.auth.BiudAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
@Component
public class BiudAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
Основной провайдер аутентификации для системы БИУД.
Реализует полную логику метода checkPassword() из DBUserRegistry, включая:
- Проверку существования пользователя
- Проверку всех типов блокировок (через BiudBlockChecker)
- Проверку пароля (через BiudPasswordEncoder — SHA1+BASE64)
- Учёт неудачных попыток входа (через TekRabService)
- Логирование в CS.ENTERLOG (через AuthLogger)
Поток аутентификации:
- Загрузить пользователя через BiudUserDetailsService
- Получить количество неудачных попыток из TekRabService
- Проверить блокировки через BiudBlockChecker
- Если не заблокирован — проверить пароль через BiudPasswordEncoder
- При успехе — сбросить счётчик попыток, залогировать успех
- При ошибке — увеличить счётчик попыток, залогировать неудачу
-
Constructor Summary
ConstructorsConstructorDescriptionBiudAuthenticationProvider(org.springframework.security.core.userdetails.UserDetailsService userDetailsService, BiudPasswordEncoder passwordEncoder, BiudBlockChecker blockChecker, TekRabService tekRabService, AuthLogger authLogger, BiudPropsBiudRepository propsBiudRepository, BiudOperatorRepository operatorRepository) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) Выполнить аутентификацию пользователя.booleanПроверить, поддерживает ли этот провайдер данный тип аутентификации.
-
Constructor Details
-
BiudAuthenticationProvider
public BiudAuthenticationProvider(org.springframework.security.core.userdetails.UserDetailsService userDetailsService, BiudPasswordEncoder passwordEncoder, BiudBlockChecker blockChecker, TekRabService tekRabService, AuthLogger authLogger, BiudPropsBiudRepository propsBiudRepository, BiudOperatorRepository operatorRepository)
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException Выполнить аутентификацию пользователя.Полная реализация логики checkPassword() из DBUserRegistry.
- Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
supports
Проверить, поддерживает ли этот провайдер данный тип аутентификации.- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-