Squirrel Unauthorized Client Issue

154 views
Skip to first unread message

Michael Houck

unread,
Aug 24, 2013, 5:05:13 PM8/24/13
to google-cloud...@googlegroups.com
I'm following the steps in this guide to test out external application access to the Google Cloud SQL:

https://developers.google.com/cloud-sql/docs/admin_tools

and when I get to the test portion, it's giving me this error:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: 400 Bad Request
{
  "error" : "unauthorized_client"
}

I've tried revoking the access, deleting the OAuth keys in the registry and then regaining access via the google_sql.cmd tool (where I go to the link and paste the auth code into the cmd window) and also via the gauth python script in the /bin directory.  I can connect to the database fine with the google_sql command line, but whenever I test the connection in Squirrel SQL it gives me the unauthorized access issue.

Can anyone help me out on this?

Amit Mondal

unread,
Aug 24, 2013, 9:53:52 PM8/24/13
to google-cloud...@googlegroups.com

Is it running as same user?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/5a9a75c9-5584-41fa-b679-70053f331ef5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Michael Houck

unread,
Aug 25, 2013, 10:35:37 AM8/25/13
to google-cloud...@googlegroups.com
I've run both on the same machine with only one google login set up.  Is there a different OAuth file for the python google-sql command line vs the OAuth used by the JDBC driver?


On Saturday, August 24, 2013 9:53:52 PM UTC-4, Amit Mondal wrote:

Is it running as same user?

On Aug 24, 2013 2:05 PM, "Michael Houck" <mho...@gmail.com> wrote:
I'm following the steps in this guide to test out external application access to the Google Cloud SQL:

https://developers.google.com/cloud-sql/docs/admin_tools

and when I get to the test portion, it's giving me this error:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: 400 Bad Request
{
  "error" : "unauthorized_client"
}

I've tried revoking the access, deleting the OAuth keys in the registry and then regaining access via the google_sql.cmd tool (where I go to the link and paste the auth code into the cmd window) and also via the gauth python script in the /bin directory.  I can connect to the database fine with the google_sql command line, but whenever I test the connection in Squirrel SQL it gives me the unauthorized access issue.

Can anyone help me out on this?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Amit Mondal

unread,
Aug 25, 2013, 4:18:35 PM8/25/13
to google-cloud...@googlegroups.com
Are you running Squirrel from the same Linux/Windows account as the command line tool? This is important because the oauth2 token is shared.


To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a5744803-5277-4325-9e49-c08aeae1a261%40googlegroups.com.

Michael Houck

unread,
Aug 25, 2013, 4:33:35 PM8/25/13
to google-cloud...@googlegroups.com
Yes, both are run on the exact same machine on the same account.


On Sunday, August 25, 2013 4:18:35 PM UTC-4, Amit Mondal wrote:
Are you running Squirrel from the same Linux/Windows account as the command line tool? This is important because the oauth2 token is shared.
On Sun, Aug 25, 2013 at 7:35 AM, Michael Houck <mho...@gmail.com> wrote:
I've run both on the same machine with only one google login set up.  Is there a different OAuth file for the python google-sql command line vs the OAuth used by the JDBC driver?


On Saturday, August 24, 2013 9:53:52 PM UTC-4, Amit Mondal wrote:

Is it running as same user?

On Aug 24, 2013 2:05 PM, "Michael Houck" <mho...@gmail.com> wrote:
I'm following the steps in this guide to test out external application access to the Google Cloud SQL:

https://developers.google.com/cloud-sql/docs/admin_tools

and when I get to the test portion, it's giving me this error:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: 400 Bad Request
{
  "error" : "unauthorized_client"
}

I've tried revoking the access, deleting the OAuth keys in the registry and then regaining access via the google_sql.cmd tool (where I go to the link and paste the auth code into the cmd window) and also via the gauth python script in the /bin directory.  I can connect to the database fine with the google_sql command line, but whenever I test the connection in Squirrel SQL it gives me the unauthorized access issue.

Can anyone help me out on this?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Rob Clevenger

unread,
Aug 25, 2013, 4:33:46 PM8/25/13
to google-cloud...@googlegroups.com
Ah yes. The python google-SQL uses a different token store than the java one google_sql.sh is the one you want.  I'm aware this is confusing and will be remedied soon.

Rob
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a5744803-5277-4325-9e49-c08aeae1a261%40googlegroups.com.

Michael Houck

unread,
Aug 25, 2013, 4:47:27 PM8/25/13
to google-cloud...@googlegroups.com
Thanks, I'm on Windows so I couldn't run the .sh, but when I ran:

java -jar google_sql.jar <instance>

it connected without asking for any credentials... then when I tried Squirrel again it worked.

Do you know where the different tokens are stored in Windows?  Are they both in the registry?


On Sunday, August 25, 2013 4:33:46 PM UTC-4, Rob wrote:
Ah yes. The python google-SQL uses a different token store than the java one google_sql.sh is the one you want.  I'm aware this is confusing and will be remedied soon.

Rob

On Sunday, August 25, 2013, Michael Houck wrote:
I've run both on the same machine with only one google login set up.  Is there a different OAuth file for the python google-sql command line vs the OAuth used by the JDBC driver?

On Saturday, August 24, 2013 9:53:52 PM UTC-4, Amit Mondal wrote:

Is it running as same user?

On Aug 24, 2013 2:05 PM, "Michael Houck" <mho...@gmail.com> wrote:
I'm following the steps in this guide to test out external application access to the Google Cloud SQL:

https://developers.google.com/cloud-sql/docs/admin_tools

and when I get to the test portion, it's giving me this error:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: 400 Bad Request
{
  "error" : "unauthorized_client"
}

I've tried revoking the access, deleting the OAuth keys in the registry and then regaining access via the google_sql.cmd tool (where I go to the link and paste the auth code into the cmd window) and also via the gauth python script in the /bin directory.  I can connect to the database fine with the google_sql command line, but whenever I test the connection in Squirrel SQL it gives me the unauthorized access issue.

Can anyone help me out on this?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

Razvan Musaloiu-E.

unread,
Aug 25, 2013, 9:39:33 PM8/25/13
to google-cloud...@googlegroups.com
The OAuth2 token used by the Python should be in ~/.googlesql_oauth2.dat in Linux and in %USERPROFILE%\.googlesql_oauth2.dat in Windows.

Reference: https://developers.google.com/appengine/docs/python/cloud-sql/django#authentication

-- Razvan ME


To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/8f6310ba-b7db-4975-87e4-5e7f4f08bbc1%40googlegroups.com.

John Gale

unread,
Sep 24, 2013, 6:09:19 AM9/24/13
to google-cloud...@googlegroups.com
I wish this topic appeared higher up on Google's search results page! 

I've been searching for this for 2.5 - 3 hours!

Using the Python SDK I was able to connect via command line but not via SQuirreL SQL Client.

Following from what was said above, I connected to the Java SDK command line tool just once, restarted the SQuirreL SQL Client and volia, I can now connect! 

This really should be documented somewhere more official!!


On Sunday, 25 August 2013 21:33:46 UTC+1, Rob wrote:
Ah yes. The python google-SQL uses a different token store than the java one google_sql.sh is the one you want.  I'm aware this is confusing and will be remedied soon.

Rob

On Sunday, August 25, 2013, Michael Houck wrote:
I've run both on the same machine with only one google login set up.  Is there a different OAuth file for the python google-sql command line vs the OAuth used by the JDBC driver?

On Saturday, August 24, 2013 9:53:52 PM UTC-4, Amit Mondal wrote:

Is it running as same user?

On Aug 24, 2013 2:05 PM, "Michael Houck" <mho...@gmail.com> wrote:
I'm following the steps in this guide to test out external application access to the Google Cloud SQL:

https://developers.google.com/cloud-sql/docs/admin_tools

and when I get to the test portion, it's giving me this error:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: 400 Bad Request
{
  "error" : "unauthorized_client"
}

I've tried revoking the access, deleting the OAuth keys in the registry and then regaining access via the google_sql.cmd tool (where I go to the link and paste the auth code into the cmd window) and also via the gauth python script in the /bin directory.  I can connect to the database fine with the google_sql command line, but whenever I test the connection in Squirrel SQL it gives me the unauthorized access issue.

Can anyone help me out on this?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.

z
This message is for the named person's use only.  If you receive this message in error, please delete it and notify the sender.  Appogee is the products division of Ancoris Limited.
Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ
Reply all
Reply to author
Forward
0 new messages