[英]spring security- catch exception inside the authentication failure url
我使用實現UserDetails進行身份驗證的類。 在其中,我傳遞了自定義異常,就像嘗試次數超過了userNotFoundException一樣。
我想知道如何在身份驗證失敗URL中捕獲此異常。
我假設您有一個實現UserDetailsService
的類,並且拋出了要在AuthenticationFailureHandler
捕獲的自定義異常。 在這種情況下,您的自定義異常應擴展AuthenticationException,並且登錄篩選器會將其傳遞給AuthenticationFailureHandler
onAuthenticationFailure
方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.