New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Google authentication strategy #342
Conversation
This looks great. Thanks. I'll give it a try this weekend and update the docs too. I'm not sure why I did not use 'desktop app' in the first place, but its too long ago to remember! |
Hi Marco, I think I need help generating the application token. Using your code I'm still getting the error in #341. Did you use a different workflow to generate the App token? Thanks |
Verify the
in redirect URIs |
Thanks, I now have it working. One of the things I need to support is non-GUI authentication for people running gphotos-sync on a server or in a container. It looks like I can achieve this with: This is only going to work if host is routable from the workstation where the user runs their browser. Its a new limitation but worth the fix. Many thanks. |
I think the limitation can be solved using run_console:
Maybe a new CLI parameter can be added to choose with strategy use. I'll try and open a new PR |
Hi Marco,
The first thing I tried was run_console and it does not seem to use the
localhost server. If you can make it work I would be interested as this
would be the preferred solution.
Thanks.
…On Mon, 25 Apr 2022 at 07:57, Marco Caberletti ***@***.***> wrote:
I think the limitation can be solved using run_console
<https://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_console>
:
flow.run_console()
Maybe a new CLI parameter can be added to choose with strategy use. I'll
try and open a new PR
—
Reply to this email directly, view it on GitHub
<#342 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHLRW5HLI2A5MBUZB3XV4DVGY665ANCNFSM5TSW56NA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
@marcocaberletti any ideas on this? flow.run_local_server(open_browser=False)
So you can see why the second one does not work. |
I see the deprecated redirect uri in the second URL. |
Hi @gilesknap ,
|
Thanks, I'm going to go with this: flow.run_local_server(open_browser=False, host=hostname) where hostname can be passed on the command line. Then it can be made to work as long as you have a workstation with a browser that can route to hostname. |
This PR changes the authentication strategy, using the OAuth2 Device code flow (aka "Desktop app" in Google credentials language)
This change resolves also #341