Closed keenonkites closed 1 year ago
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.
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.
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.
PS: as you warned me in the previous issue, gdrive is indeed a pain to work with... I couldn't find an easier way.
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...
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.
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
I'm not sure if the downloadpart from Sonny is already running or if I cought it in an intermediate state.
It looks like I got the google drive authentication running, at least I do not get any errormessages related to this.
But when running the tool I get the following errormessages:
Can you tell me if and what I'm doing wrong ? ....
Cheers Patrik