Skip to content

Add "Device Code" as a supported OAuth Flow #2381

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

Closed
LikeLakers2 opened this issue Oct 23, 2020 · 5 comments
Closed

Add "Device Code" as a supported OAuth Flow #2381

LikeLakers2 opened this issue Oct 23, 2020 · 5 comments
Labels
security: auth Authentication including overlap with authorization security
Milestone

Comments

@LikeLakers2
Copy link

LikeLakers2 commented Oct 23, 2020

Hi! I'm not in the business of making APIs myself, so I don't know how helpful I can be. However, I found that RFC8628 offers a "Device Code" type of OAuth, which I thought might be useful if it were supported by default by OpenAPI. The flow is described at https://oauth.net/2/grant-types/device-code/ as follows:

The Device Code grant type is used by browserless or input-constrained devices in the device flow to exchange a previously obtained device code for an access token.

Looking at the RFC myself, it seems like this type of OAuth Flow would need the a device authorization URL (different from a regular authorizationUrl in that this is called by the application, not the user -- the RFC has more info under section 3.1), a tokenUrl, and potentially a refreshUrl. Given how this endpoint works, it may also benefit from a optional deviceCodeFormat field, specifying what characters are allowed, how the code can be formatted (uppercase? lowercase? case-insensitive? etc.) and so on. (Turns out I was misreading the RFC -- the authorization server generates the device code, not the client)

Hopefully this isn't too far-fetched of a suggestion! :)

@LikeLakers2 LikeLakers2 changed the title Add "Device Code" as a supported Security Scheme Add "Device Code" as a supported OAuth Flow Oct 23, 2020
@MikeRalphson MikeRalphson reopened this Oct 24, 2020
@philsturgeon
Copy link
Contributor

@LikeLakers2 could you have a go at making a PR for this?

@LikeLakers2
Copy link
Author

LikeLakers2 commented Nov 4, 2020

@philsturgeon Although I've never written anything of a specification before (aside from some notes in Notepad), I think I could give it a shot. It doesn't sound too hard, considering what little I think I'd have to add. Also it's good experience for writing a specification. :)

@CameronGo
Copy link

Is there any information available on when this will be formally supported in the OpenAPI spec?

@handrews handrews added the security: auth Authentication including overlap with authorization label Feb 1, 2024
@LasneF
Copy link
Member

LasneF commented Mar 21, 2024

@handrews looks it has been merged, it should be good ? or does the ticket kept open till version 3.2 is released ?

@handrews
Copy link
Member

@LasneF we can close it - I don't always remember to check if the PR merging automatically closed the issue, thanks for noticing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security: auth Authentication including overlap with authorization security
Projects
None yet
Development

No branches or pull requests

6 participants