Add support for OAUTH2 device flow (RFC 8628) #302
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! Thank you for the great tool!
Could you please take a look at this PR?
Description
This PR adds support for OAUTH2 device flow:
Device flow is particularly useful on headless systems, as it does not require usage of the redirect URL.
I successfully tested this PR with a free Microsoft account (
outlook.com
), and own applicationclient_id
.The application (
client_id
) must be explicitly allowed to use the device flow in the Azure console.Implementation
The following properties are introduced into the request propagated from OAUTH2 to the main app:
need_response
: A boolean specifying the flow implies a response from a user to be provided to the proxy in order to retrieve the tokens. It isfalse
for device flow, andtrue
for others.user_code
: A (short) string, which should be provided to the user for authentication at the service provider. User should manually enter it at the provider's web page.The following changes are done to the UI, both graphical and console:
QA
I tested the proxy on Linux systems, in container and on desktop.
The following test cases are successful:
Attention! On my systems I cannot make GUI work at all (even without my changes). The icon in the tray is always frozen, without notifications, and without context menu.
Therefore I cannot validate that the changes are correct for GUI interaction.