Skip to content
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

Add support for device authorization flow (RFC8628) #795

Merged
merged 4 commits into from Jan 18, 2022

Conversation

kellyma2
Copy link
Contributor

This change adds support for device authorization flow with a new DeviceClient implementation that is derived somewhat from MobileApplicationClient and BackendApplicationClient.

DeviceClient provides a method to:

(1) generate the request URI for device code and authorization URLs

(2) query the token endpoint with a provided device code to retrieve the OAuth token

Additionally, a unit test is provided in order to validate the DeviceClient operations

This change adds an implementation of the Device Authorization flow
client from RFC8628.  The initial structure is derived from the
existing BackendApplicationClient with the addition of the device_code
in the client.

This change does not provide the support necessary for querying the
device code endpoint in order to generate the initial device_code and
URL that is required for completing the full end to end device
authorization process.
In order to perform the full device authorization flow it's necessary
to first generate the device code and get the authorization flow URL.

prepare_request_uri() allows us to do this while providing scopes and
additional parameters.
oauthlib/oauth2/rfc8628/clients/__init__.py Outdated Show resolved Hide resolved
tests/oauth2/rfc8628/clients/test_device.py Outdated Show resolved Hide resolved
@auvipy
Copy link
Contributor

auvipy commented Dec 23, 2021

overall looks good

These lines are not required for python3
@kellyma2 kellyma2 requested a review from auvipy December 23, 2021 05:44
@auvipy auvipy added this to the 3.2.0 milestone Dec 23, 2021
@kellyma2
Copy link
Contributor Author

@auvipy are you able to go through this again? also @JonathanHuot?

@auvipy auvipy merged commit c3e8787 into oauthlib:master Jan 18, 2022
@JonathanHuot JonathanHuot added Feature OAuth2-Client This impact the client part of OAuth2. labels Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature OAuth2-Client This impact the client part of OAuth2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants