Code Monkey home page Code Monkey logo

Comments (7)

agrenott avatar agrenott commented on June 3, 2024

From the stack trace it seems it's failing while leading the client secrets file. Did you download it and put it in ~/.pyhgtmap/client-secret.json ?
If it works you should get a request from the CLI to open a link to continue the OAuth process.

from pyhgtmap.

keenonkites avatar keenonkites commented on June 3, 2024

Downloaded, yes.... but if I have it with the name client-secret.json the system is complaining about missing gdrive-credentials.json and asks me for opening something on the browser and for verification code.... as I'm running on a server without gui, I can't open that there.... and if I do that on my local windows:

/home/xyz/venv_pyhgtmap/lib/python3.8/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /home/xyz/.pyhgtmap/gdrive-credentials.json: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Go to the following link in your browser:

    XXXX

Enter verification code:

I most probably did something wrong, but can't figure out what.

from pyhgtmap.

agrenott avatar agrenott commented on June 3, 2024

What you describe is the CLI OAuth workflow.
The grdive-credentials file is where the oauth details are cached after first successful auth (to avoid doing it at each run).
You have to copy paste the displayed link into any browser. This will redirect you too google OAuth process where you have to agree to have gdrive permission to your insurance of pyhgtmap. It will then provide you a code you have to copy paste into the prompt of pyhgtmap CLI.

from pyhgtmap.

agrenott avatar agrenott commented on June 3, 2024

PS: as you warned me in the previous issue, gdrive is indeed a pain to work with... I couldn't find an easier way.

from pyhgtmap.

keenonkites avatar keenonkites commented on June 3, 2024

When I copy that to my browser on the local workstation I get following error message:

Access blocked: This app’s request is invalid
...
You can’t sign in because this app sent an invalid request. You can try again later or contact the developer about this issue. [Learn more about this error](https://developers.google.com/identity/protocols/oauth2/openid-connect#setredirecturi)
If you are a developer of this app, see [error details](https://accounts.google.com/).
Error 400: redirect_uri_mismatch

I'm sure I messed it up with the client-secret.json while creating it.... but I can't figure out what...
Yes, looks like some sort of complicated... ;-)

BTW: thanks for your support anyway.... hopefully others can profit also...

from pyhgtmap.

agrenott avatar agrenott commented on June 3, 2024

Did you follow those instructions to create your API credentials?
https://docs.iterative.ai/PyDrive2/quickstart/#authentication
The redirect_uri_mismatch makes me think you either didn't declare a desktop application, or you didn't out localhost as url.

from pyhgtmap.

keenonkites avatar keenonkites commented on June 3, 2024

I did follow the instructions.... probably too close:

  • Select ‘Application type’ to be Web application.
  • Enter an appropriate name.
  • Input http://localhost:8080/ for ‘Authorized redirect URIs’.
  • Click ‘Create’.

What did the trick is to create a desktop Application, you probably should mention that explicitly in the README.md of the repo.

Now I was able to create the code with a browser on my local machine, finish the autenthication properly and download some test data.

Thanks for your help again. I probably do further testing this evening (CET).
Cheers Patrik

from pyhgtmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.