GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
320 stars 59 forks source link

Google cloud sql iam auth login isn't working with datagrip and google cloud code plugin #3166

Open its-raj21 opened 1 year ago

its-raj21 commented 1 year ago

HI Team,

IDE: Datagrip DB: mysql 8

I'm able to connect to google cloud sql using cloud iam auth with cloud proxy using the following command.

cloud-sql-proxy -i --private-ip

Then in datagrid datasource, just user username without password.

But I really didn't find any option to enable Automatic IAM Authentication with cloud code plugin.

When I tried to use my IAM id, I always get the following error. SSL connection required for plugin "mysql_clear_password". Check if 'sslMode' is enabled.

I tried all possible solution from internet, I didn't help. As per my understanding automatic iam authentication isn't enabled with cloud code.

Please assist.

Regards, Raj

ivanporty commented 1 year ago

Thanks for the report @its-raj21! We do have an option to connect using Private IP

Screenshot 2023-10-25 at 11 54 49 AM

Does it help or you are always required to enter password when using Cloud Code connection?

its-raj21 commented 1 year ago

private ip is not the problem, we are able to connect using cloud sql proxy (Private IP) For IAM auth, with password or without password, we get the following error. SSL connection required for plugin "mysql_clear_password". Check if 'sslMode' is enabled.

steps to reproduce the the issue.

Create a user for sql instance with IAM auth (cloud identity) and try to login with that user. I believe Automatic IAM Authentication option is missing with cloud code.

Cli have the following flag. -i, --auto-iam-authn (*) Enables Automatic IAM Authentication for all instances

ivanporty commented 1 year ago

Thanks @its-raj21! We will look into adding support for IAM auth in Cloud Code and let you know.

ElpayetSupervan commented 2 months ago

I face the same issue. Any guidance available ?

ivanporty commented 2 months ago

There is no near term plan to add this yet, but we will increase the priority on this item.