-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Support for authentication_openid_connect Plugin #1713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi , I found a way to get JWT authentication working with the authentication_openid_connect plugin by making a few targeted changes to the go-sql-driver/mysql source code. I’ve detailed everything below, including references to the MySQL protocol and the exact code changes I made. I hope this can be helpful, and I’d be happy to collaborate further if this is something you’d consider integrating upstream. Here’s the complete breakdown: Protocol ReferenceAccording to the MySQL documentation,
Packet structure:
The length-encoded string format is described here: Summary of Required Modifications1. DSN Parsing
2.
|
Hi
I am currently using the go-sql-driver/mysql driver to connect to a MySQL database that requires OpenID Connect authentication. I am encountering an issue when attempting to use the authentication_openid_connect plugin with this driver.
The plugin is returning the following error during the client-server handshake (mysql Log) :
Additionally, the Go client (go-sql-driver/mysql) outputs:
When I try to connect using the following DSN:
I have confirmed that the OIDC configuration and token generation are correct, as I am able to use the generated token successfully via curl. However, when attempting to use the token in my Go application with the go-sql-driver/mysql, the authentication fails with the error mentioned above.
Here is a summary of the steps I have taken:
1. The MySQL server has the authentication_openid_connect plugin properly configured.
2. I use the clientcredentials.Config structure from the oauth2 package to obtain an OIDC token.
3. I pass the token as the password in the MySQL connection string.
4. The error persists, even though the token works with curl and is valid.
Could you provide any guidance or recommendations for fixing this issue? Is there anything specific that might need to be done on the go-sql-driver/mysql side to properly handle the OIDC authentication handshake?
Driver version : v1.9.2
Go version: go1.23.6 darwin/arm64
Server version: MySQL Enterprise 9.2
Server OS: : container image on podman 5.2.3
Thank you in advance for your help!
The text was updated successfully, but these errors were encountered: