Class DaoAuthenticationManagers

java.lang.Object
io.leandev.appfuse.security.auth.DaoAuthenticationManagers

public final class DaoAuthenticationManagers extends Object

DAO 帳密認證鏈的 builder。

集中 DaoAuthenticationProviderProviderManager 的固定建構機制,尤其是手動建立 ProviderManager 時容易遺漏的 authentication event publisher。消費端仍明確擁有政策:

  • 要使用哪個 UserDetailsService
  • 要使用哪個 PasswordEncoder
  • 是否覆寫 pre-authentication checks(例如互動登入的 login lockout)

未指定 pre-authentication checks 時保留 DaoAuthenticationProvider 的標準帳號狀態檢查, 適合不套用互動登入鎖定的 M2M client_credentials 路徑。

  • Method Details

    • builder

      public static DaoAuthenticationManagers.Builder builder(org.springframework.security.core.userdetails.UserDetailsService userDetailsService, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, org.springframework.context.ApplicationEventPublisher eventPublisher)
      建立 DAO manager builder。