oauth2 icon indicating copy to clipboard operation
oauth2 copied to clipboard

oauth2: add device flow support

Open centimitr opened this issue 6 years ago • 11 comments
trafficstars

draft-ietf-oauth-device-flow https://tools.ietf.org/html/draft-ietf-oauth-device-flow-13

Draft: device flow is still a draft, but it is a very handy flow for many practical cases.

This pr includes an early stage implementation of the device flow, according to the draft, and it works with Azure AD. I am going to add tests and doing some refactor, like renaming AuthCodeOption with type alias etc. I am looking for the time it can be merged as a standard.

centimitr avatar Jan 07 '19 14:01 centimitr

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

googlebot avatar Jan 07 '19 14:01 googlebot

I signed it!

centimitr avatar Jan 07 '19 14:01 centimitr

CLAs look good, thanks!

googlebot avatar Jan 07 '19 14:01 googlebot

This PR (HEAD: 7cf8880eb1e002ce6fb90ffadae90b41452462e3) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/oauth2/+/156537 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 07 '19 14:01 gopherbot

Message from Gobot Gobot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps: Within the next week or so, a maintainer will review your change and provide feedback. See https://golang.org/doc/contribute.html#review for more info and tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be surprising to people new to the project. The careful, iterative review process is our way of helping mentor contributors and ensuring that their contributions have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which little code gets reviewed or merged. If a reviewer responds with a comment like R=go1.11, it means that this CL will be reviewed as part of the next development cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/156537. After addressing review feedback, remember to publish your drafts!

gopherbot avatar Jan 07 '19 14:01 gopherbot

any chance to have this merged? "device flow" has become quite common.

mihaiav avatar Oct 15 '19 08:10 mihaiav

@devbycm I believe you should have a select on <- ctx.Done() inside that loop to check of context cancelation.

mihaiav avatar Jan 31 '20 17:01 mihaiav

Message from Go Bot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps: Within the next week or so, a maintainer will review your change and provide feedback. See https://golang.org/doc/contribute.html#review for more info and tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be surprising to people new to the project. The careful, iterative review process is our way of helping mentor contributors and ensuring that their contributions have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which little code gets reviewed or merged. If a reviewer responds with a comment like R=go1.11, it means that this CL will be reviewed as part of the next development cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/156537. After addressing review feedback, remember to publish your drafts!

gopherbot avatar Oct 15 '20 03:10 gopherbot

Hey, please fix the conflicting file. This feature will be so useful!

mniak avatar Feb 07 '21 17:02 mniak

@centimitr Hello, thanks for this PR. Apart from the conflict, is there anything else missing? any chance to have this merged?

GreyXor avatar Sep 09 '21 14:09 GreyXor

@centimitr are you able to fix the merge conflicts and get this merged? If no, is it ok to take it over and get this delivered?

Morishiri avatar May 06 '22 09:05 Morishiri

This PR has many issues like infinite loop on unexpected / ignored errors, or unmarshal errors due to wrong fields types caused by it being too focus /based on azure ad implementation. It should not be merged as is.

Adphi avatar Oct 29 '22 00:10 Adphi

Implemented in https://github.com/golang/oauth2/commit/e3fb0fb3af0ee7c0c62e31c393cbcfce6b2af5bf

hickford avatar Sep 07 '23 22:09 hickford