【问题标题】:mod_dbd with AuthQuery to handle MD5 & salt not working带有 AuthQuery 的 mod_dbd 来处理 MD5 和 salt 不起作用
【发布时间】:2019-09-24 05:27:58
【问题描述】:

运行centOS 7.5、mysql 8、php 7.2、apache 2.4.6 试图让 mysql 身份验证适用于我使用的 php 应用程序,该应用程序将其密码存储为 md5(md5('pass').salt)

我已经确认加载了正确的模块(如果需要可以提供列表)

我的密码不匹配 [auth_basic:error] [pid 5195] [client 10.10.10.111:49234] AH01617:用户ecourt:“/central”身份验证失败:密码不匹配

这是 /etc/httpd/conf.d 目录中我的 central.conf 文件中的代码

# mod_dbd configuration
# UPDATED to include authentication cacheing
DBDriver mysql
DBDParams "host=localhost dbname=bb user=userU pass=somepass"

DBDMin  4
DBDKeep 8
DBDMax  20
DBDExptime 300

<Directory "/webroot/test/www/central">
  # mod_authn_core and mod_auth_basic configuration
  # for mod_authn_dbd
  AuthType Basic
  AuthName "central login" 

  # To cache credentials, put socache ahead of dbd here
  AuthBasicProvider socache dbd

  # Also required for caching: tell the cache to cache dbd lookups!
  AuthnCacheProvideFor dbd
  AuthnCacheContext my-server

  # mod_authz_core configuration
  Require valid-user
  # Require group 10 8 6

   # mod_authn_dbd SQL query to authenticate a user
   #AuthDBDUserPWQuery "SELECT password FROM user WHERE username = %s"
   AuthDBDUserPWQuery "SELECT MD5(MD5(password) + 'salt') AS password FROM     user WHERE username = %s"

</Directory>

感谢任何帮助。 谢谢

【问题讨论】:

  • 由于我没有取得任何进展,因此将尝试创建一个测试数据库,在其中我可以控制密码散列,从简单开始,看看它在什么时候停止工作。

标签: mysql apache centos7


【解决方案1】:

'salt' 是一个字符串('单引号'),也许你的意思是列 `salt`(`backticks`)?

见:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-19
    • 1970-01-01
    • 2012-04-10
    • 2014-08-01
    • 1970-01-01
    • 2010-11-09
    相关资源
    最近更新 更多