簡體   English   中英

已棄用SPRING_SECURITY_LAST_USERNAME_KEY的Grails Spring安全性替代方案

[英]Grails spring security alternative for deprecated SPRING_SECURITY_LAST_USERNAME_KEY

我正在開發grails應用程序,在這里我需要弄亂Session變量以實現Custom Spring Security身份驗證,並且需要設置以下內容:

request.session[SPRING_SECURITY_LAST_USERNAME_KEY] =
            TextEscapeUtils.escapeEntities(username)

現在,此密鑰來自現已棄用的org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY 您能建議我替代此方法嗎?

是的,我也遇到過同樣的問題。 它有一個非常簡單的替代方案-

import grails.plugin.springsecurity.SpringSecurityUtils;

現在使用SpringSecurityUtils.SPRING_SECURITY_LAST_USERNAME_KEY它將起作用並且不建議使用。

暫無
暫無

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

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