mysql - 带有 AuthQuery 的 mod_dbd 来处理 MD5 和 salt 不起作用
问题描述
运行 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>
任何帮助表示赞赏。谢谢
解决方案
'salt' is a string ('single quotes'), maybe you mean the column `salt` (`backticks`)?
see:
推荐阅读
- python - 用于制作 python 装饰器类的精益接口
- python - stem.connection.IncorrectSocketType:无法使用控制套接字
- move - 终端中的 Windows XP SP1 复制命令不起作用
- sql-server - 创建有权授予 dbo 模式的数据库用户/角色
- sql - SQL Server Always On 可用性组卡在“同步/恢复中”
- c# - 为什么向 C# 程序添加新代码文件会导致创建表单(菜单)?
- java - Modelmapper 无法映射整个模型?
- scala - 为什么正确的类型 Any 和 Nothing 适合类型构造函数形状 F[_] 当它们是不同的类型时?
- python - 如何使用像素完美碰撞与两个图像pygame
- python - 允许从网络访问隐藏文件夹。破折号