abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
9.63k stars 849 forks source link

Feature Request: Consider adding support for the OAuth2 Device Authorization Flow #2693

Open MarkJaroski opened 3 months ago

MarkJaroski commented 3 months ago

Is your feature request related to a problem? Please describe.

OAuth2 has a device authorization flow which could provide a smoother authentication method compared to the native application flow which the project uses at the moment.

Describe the solution you'd like

The user should be able to specify the device authorization flow as an option. In this flow the native application presents an 8 character code to the user, who then enters it online, which either authorizes the application against an existing session or authenticates the user.

Describe alternatives you've considered

Well, you could eventually pop up a browser window, but that would be a lot harder to achieve.

Additional context

No response

kevinchristianson commented 2 months ago

I'm trying to auth in ubuntu server and am struggling to complete the loop with no GUI. I second the request for an alternate device authorization flow.

abraunegg commented 2 months ago

@kevinchristianson

I'm trying to auth in ubuntu server and am struggling to complete the loop with no GUI.

FYI - you do not need a GUI to complete the auth process.

You can copy the auth URL to any system, do the auth there, then copy the URI back to the prompt.

MarkJaroski commented 2 months ago

FYI - you do not need a GUI to complete the auth process.

You can copy the auth URL to any system, do the auth there, then copy the URI back to the prompt.

I can absolutely verify this, and the nativeclient approach isn't a problem for me at all. I've even borrowed this technique - which I first learned about here - in a set of scripts that I wrote to demonstrate OAuth2 flows for my colleagues (and vendors !)

But the device flow is easier for people to understand, so it would be nice to have.

kevinchristianson commented 1 month ago

Sorry for not responding earlier--haven't had a chance to get back to this. I have tried copying the URL to another system and copying the response URL back but I'm still hitting 400s. Probably something on my end though if other users aren't hitting it.

abraunegg commented 1 month ago

@kevinchristianson Ensure you are pasting back the FULL response URI back to the application. Also ensure your system running 'onedrive' can access the required URL that validates the URI.

You can also double check what is going when you paste the repsonse on by running the application with -v -v --debug-https at startup