-
-
Notifications
You must be signed in to change notification settings - Fork 493
Allow user_code to be configured for device auth flow (Device Authorization Grant) #885
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6ed6058
to
fa221ef
Compare
Whilst oauth2 doesn't specify how the format should be the current behaviour generates a code that is not human and device friendly. e.g 6Pp9vPKaanbFydF9omtlNLLdJA4HG7 This commit makes it so that's the default behvaiour but allows the caller of DeviceApplicationServer to pass in a user code in a format they prefer in the form of a callable to be called that returns the code as a string
The json serialisation should occur at the interface level (e.g a view) that will use this method not the method itself as it can lead to "double" json serialisation or the need to use json.loads() to deserialize and serialise it again before the httpResponse is made back to the client
auvipy
requested changes
Oct 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also update the docs with example please?
f637143
to
ad919f9
Compare
481a97d
to
06d8487
Compare
@auvipy Added device docs |
bddc462
to
6862c41
Compare
auvipy
approved these changes
Oct 17, 2024
merging this, but feel free to contribute back if any edge case arises |
Open
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Oauth2 doesn't specify the format of the
user_code
token but ideally it should be something human and device display friendly with a decent enough amount of entropy. e.g something short like ME3-2FDSo let's allow this code to be configured based on the needs of the device instead.
The current token generation logic is now the default behaviour
e.g response
@ maintainers, I'm currently working on a pr for this issue in DOT so I have tested this with a view i've implemented on a branch there, that a custom authentication server I'm working on is using.