Presto DB Support. Password Prompt?

Answered

Hi,

I am attempting to connect to a local PrestoDB db using DataGrip but having some troubles.

My PrestoDB instance does not require a password but no matter what I do, DataGrip prompts for credentials.

- Downloaded the presto JDBC driver: presto-jdbc-329.jar

- Created a new driver in DataGrip using this file

- Created a new data source using this driver and URL of: jdbc:presto://localhost:8080?user=ivan

 

Is there a problem connecting to databases that do not require a password? If I add a blank password, I get the error:

'Authentication using username/password requires SSL to be enabled'

 

Also I have tried using the same driver in a simple java class and it works fine, connecting to the same presto instance.

 

Thanks,

Ivan

10 comments
Comment actions Permalink

You can either go to the Advanced tab and add the property "SSL" and set it to "true" or change your url to jdbc:presto://localhost:8080?SSL=true&user=ivan

0
Comment actions Permalink

Greg Stearns specifying SSL=true isn't necessary in connection URL because it seems that DataGrip forces this as soon as define user for connection. 

vasily chernov I'm having the same problem and JDBC options aren't helping. As same options (connection URL) works from DBeaver

This seems to be the problem on DataGrip side as it requires both "password=secret" and "SSL=true" parameters if "user" parameter is set. However, Presto driver requires user parameter to be set, event when it doesn't have SSL enabled and it doesn't require "password" parameter. 

This is not the first time I'm having connection problems with DataGrip (which I pay for) and no connection problems with DBeaver which is free

:( 

0
Comment actions Permalink

Please provide complete error message.
We have heuristic that show error message + password prompt if you have no password and connection have failed. That is because we can not tell if the failure is because of the missing password and do not want our users to go to the settings if does.
Just show us the message in that dialog

 

 

1
Comment actions Permalink

The error message is:
"The specified database user/password combination is rejected: Authentication using username/password requires SSL to be enabled" and I'm presented with user/password prompt.


Note that Presto cluster is configured without SSL, which is the same as the data source. Also, Presto is configured without authentification, but it requires that there is something specified in the username field (anything will do), and not to specify anything in the password field.

0
Comment actions Permalink

Looks like using string

***empty***

as a password will do the job. This is a quote from driver jar decompiled source (version 344):

if (!password.isEmpty() && !password.equals("***empty***")) {
if (!this.useSecureConnection) {
throw new SQLException("Authentication using username/password requires SSL to be enabled");
}

builder.addInterceptor(OkHttpUtil.basicAuth(this.getUser(), password));
}
0
Comment actions Permalink

Yes, this fixes the problem, though it's interesting how DBeaver works with empty string as a password without any issues with the same driver. 

1
Comment actions Permalink

It's kinda strange. I created an issue based on your description https://youtrack.jetbrains.com/issue/DBE-11805

0
Comment actions Permalink

Also, could you try to right-click on password input and invoke `Empty password` action, then apply and try to connect again?

 

1
Comment actions Permalink

Odd. it seems to be working now. Even when I create new connection it allows me to just fill in username and not put anything to password (or set it to empty). I just leave it empty and it works. btw, I'm using presto-jdbc-329 and not 0.242 as you are.

1

Please sign in to leave a comment.