很明显代码已经说了认证完成移除credentials和其他某些安全数据
// Authentication is complete. Remove credentials and other secret data
// from authentication
org.springframework.security.authentication.ProviderManager.authenticate
package org.springframework.security.authentication.UsernamePasswordAuthenticationToken.eraseCredentials
org.springframework.security.authentication.AbstractAuthenticationToken.eraseCredentials
eraseSecret需要接口判断
getCredentials()就是密码

本文深入探讨了Spring Security中密码移除的原理,从ProviderManager.authenticate方法开始,跟踪到AbstractAuthenticationToken.eraseCredentials,详细阐述了UsernamePasswordAuthenticationToken如何清除credentials和其他敏感数据。在UserDetails的实现中,通过eraseCredentials方法确保密码信息的安全处理。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



