0

I'm using last GDAL from trunk, and trying to read from Google Maps Engine (GME) vía GME driver

I already exported

GME_API_KEY: My API Key, for the app I registered
GOA2_CLIENT_ID:  Generated with the "ClientID for installed applications" option in Google OAauth2 API Console
GOA2_CLIENT_SECRET: Idem

Also ran swig/python/scripts/gdal_auth.py script this way:

python swig/python/scripts/gdal_auth.py -s gme

Obtaining a GME_REFRESH_TOKEN, valid for 1 hour.

The problem is I'm getting a HTTP 401 error (Invalid credentials) with requests like this one

ogrinfo "GME:tables={my_table_id}"

Debugging, I've found the Authorization: Bearer HTTP header is incorrect. But I've used the same client id and client secret for QGIS GME plugin and it works.

What should I do to make the driver work?

1 Answer 1

0

I already fixed it. I had to follow these steps:

  • Define GOA2_CLIENT_ID, GOA2_CLIENT_SECRET, GME_APIKEY

  • Define GME_REFRESH_TOKEN, which allow the app to refresh the token

No problem, so far. Just followed the wiki page

  • Define GME_AUTH (or provide 'auth' in the query string). This is not specified in the wiki page, but can be found here:

The steps to get those environment vars are:

  • GOA2_CLIENT_ID, GOA2_CLIENT_SECRET, GME_APIKEY --> from Google API console

  • GME_AUTH, GME_REFRESH_TOKEN --> execute gdal_auth.py. Also stated in the wiki page. Just use the interactive option.

gdal_auth.py -s gme

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.