-
Notifications
You must be signed in to change notification settings - Fork 169
oauth2 redirect to localhost:8080 #507
Comments
If you are running this on another machine then change 'localhost' to the IP of that machine (synology)... gphotos-sync runs a little webserver on port 8080 and so it assumes where you are running the script is the same machine you are using (localhost).. |
But I always did copy and paste token from the google page to the terminal, where I ran the script. OK, when I changing localhost to my DSM hostname, google says "400: redirect_uri_mismatch" |
On google - instead of 'localhost' for the redirect on google, put in the IP (or what you call DSM hostname) of your synology (I think).. You need to put the token that you received from the google link back into the script and that's how it does it by going to the webapge that is hosted on localhost port 8080. I assume there is a blank text box that you paste the response from the google page into that localhost:8080 webpage and then it should work (I haven't done it a really long time - sorry).. So if you can get that localhost:8080 webpage working and paste the result from google into it, it should hopefully work. |
I do not see any google tokens to copy before redirecting to localhost:8080. After accepting access request on the google page, redirect is occurs. Old behaveour was waiting to paste token from browser to terminal. You script was waiting for paste instead of listenning to 8080 port afaik. |
It might be a |
ok.. Before you use that url, what happens if you try from the machine you are using your browser on (assuming you are using linux) to 'telnet dsm.mydomain.tld 8080' ? Does it show that it connects? |
Connection is refusing by the script with errors I posted above - with telnet test or after oauth redirect action. BTW I set my domain as a host in the /google_auth_oauthlib/flow.py
|
This area of running on a remote is a little fiddly and the recommendation is to do your first auth on a local copy of ghotos-sync. However, I'm sad to say that this project is now going EOL so it is not worth looking into this anymore. |
I got this to work on other scripts that use the 3-legged oauth method FYI. You request an auth url, you plug that in your browser, then you take the code= and put that into your script where the oauth authority gives you a reusable token that can be used to login without going the 3-legged procedure every time. |
"Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id= ..."
after accepting permissions, browser redirect me to the page like
http://localhost:8080/?state=Zfo......hCs1jokZiEwFM&code=4/0AQlEd8........javr_j2F_8XlsVW.....6Wj9u4s-LpuUx-evjO.......55A&scope=https://www.googleapis.com/auth/photoslibrary.readonly
I was expecting of redirect to the Google page with new token.
I used this script without docker from 2020. Today I upgraded my Synology from 6.2 and 7.2, installed app from pip, but stuck with this redirect.
Do you know what is the issue?
The text was updated successfully, but these errors were encountered: