Description
I use a bunch of mariadb servers which are protected with password+yubikey.
I'm not clear on how it's configured within the server, I don't really have visibility to that, all I know is that from PDB'ing the auth/connect code in pymysql that it looks like it's expecting the password prompt to literally be exactly: Password:
However in my case, the prompt (connections.py:912) is actually: Yubikey + password:
To Reproduce
python -c "import pymysql; pymysql.connect(host='mariadb-server', user='root', passwd='xxxx')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.9/site-packages/pymysql/connections.py", line 353, in __init__
self.connect()
File "/usr/lib/python3.9/site-packages/pymysql/connections.py", line 633, in connect
self._request_authentication()
File "/usr/lib/python3.9/site-packages/pymysql/connections.py", line 921, in _request_authentication
auth_packet = self._process_auth(plugin_name, auth_packet)
File "/usr/lib/python3.9/site-packages/pymysql/connections.py", line 1002, in _process_auth
raise err.OperationalError(
pymysql.err.OperationalError: (2059, "Authentication plugin 'b'dialog'' (None) not configured")
Expected
I don't know if I can register my own handler for this (not that it would really do much good, I don't want to write a yubikey token parser and all that) but at a very minimum I think it would be helpful to see the actual prompt or some other kind of message that at least says something to the effect of 'prompt type is not understood' instead of the above plugin 'dialog' (None) not configured
Environment
- OS: Linux (Arch, Centos7)
- Server and version:MariaDB 10.3.27
- PyMySQL version: all versions at least 0.7.2 and newer
Additional context
In my specific scenario it appears that I am hitting this because from certain network subnets my root credentials work fine without ever invoking the prompt code, but on other subnets the root user is restricted without a yubikey and therefore I get the unsupported prompt type.