Skip to content

Add support for device authorization flow (RFC8628) - #795

Merged
auvipy merged 4 commits into
oauthlib:masterfrom
kellyma2:rfc8628
Jan 18, 2022
Merged

auvipy merged 4 commits into
oauthlib:masterfrom
kellyma2:rfc8628

Conversation

@kellyma2

Copy link
Copy Markdown
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.
Comment thread oauthlib/oauth2/rfc8628/clients/__init__.py Outdated
Comment thread tests/oauth2/rfc8628/clients/test_device.py Outdated
@auvipy

auvipy commented Dec 23, 2021

Copy link
Copy Markdown
Member

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
@auvipy
auvipy requested a review from JonathanHuot December 23, 2021 06:02
@kellyma2

Copy link
Copy Markdown
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.

4 participants