簡體   English   中英

Spring Security不推薦使用@AuthenticationPrincipal

[英]Spring Security deprecated @AuthenticationPrincipal

如您所知,web.bind.annotation.AuthenticationPrincipal中的@AuthenticationPrincipal已棄用。 建議使用core.annotation.AuthenticationPrincipal。 因此,我們將import語句更改為core.annotation.AuthenticationPrincipal,現在我們得到以下錯誤:

org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.xxx.xxx.authentication.OurUserDetailsImpl]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.xxx.xxx.authentication.OurUserDetailsImpl.<init>()

這個注解有任何已知的問題嗎? PS,我們正在使用參數化構造函數,但我們沒有默認的構造函數,因此我知道這一點。 非常感謝。

確保您使用的是org.springframework.security.web.method.annotation.AuthenticationPrincipalArgum‌​entResolverorg.springframework.security.web.bind.support.AuthenticationPrincipalArgum‌​entResolver

我創建了#3771的 UPDATE來進行跟蹤,以使其在文檔中更易於遵循。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM