标签: java spring spring-boot security spring-security
我一直在编码jwt机制,当我从网络分析其他代码时,我需要为spring security设置安全上下文,我看到大多数代码都使用UsernamePasswordAuthenticationToken,但是在我的情况下,只有一个简单的id和一些凭证,所以我应该使用哪个令牌?我发现了that,并且在研究每个令牌时,都没有使用说明。
如果我将UsernamePasswordAuthenticationToken与空密码字段一起使用,也可以。可以吗?