【问题标题】:Print username and password used in spring security authentication打印spring安全认证中使用的用户名和密码
【发布时间】:2014-02-23 11:15:15
【问题描述】:

在登录页面中输入凭据时,我在登录时遇到了一些问题。出于某种原因,即使我在数据库中检查了正确的密码,我也输入了错误的密码。所以我想在控制台中打印我输入的密码。我该怎么做?

【问题讨论】:

    标签: grails spring-security


    【解决方案1】:

    我在 http://burtbeckwith.com/blog/?p=2029 上写了一个方法 - 这是之前这篇文章的后续:http://burtbeckwith.com/blog/?p=2003

    正如我在帖子中提到的,由于这将在控制台上打印明文密码,因此请务必在确定并修复错误配置后立即将其删除。

    【讨论】:

    • 我把这个类放在 src/groovy 下。你会建议我从哪里调用 additionalAuthenticationChecks ?域类?控制器?可能是 LoginController?
    • 你不叫它,Spring Security 可以。只要您的类注册为 AuthenticationProvider,它就会打印每次登录尝试的信息。
    • 我明白了!明文:来自 DB 的 'admin':'admin' 散列 '$2a$10$EqDexlHvWUL1JnaAasLRbe7JfoUKNVdLLJOd30GoK1Q.v45.wdboi' 有效:false
    猜你喜欢
    • 2014-04-05
    • 2016-05-10
    • 2012-02-08
    • 2017-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多