cli / oauth

A library for performing OAuth Device flow and Web application flow in Go client apps.
https://pkg.go.dev/github.com/cli/oauth
MIT License
466 stars 65 forks source link

[Question] Interest in adding support for the Microsoft identity platform's OAuth device flow? #10

Closed swinton closed 1 year ago

swinton commented 3 years ago

Hey there! Thanks for making this oauth module, it's awesome!

Curious if there is interest in adding support for the Microsoft identity platform's OAuth device flow?

I took a quick look at what's needed, and I think potentially the "only" change would be to support a JSON response from the device code endpoint, currently it looks like we only handle form responses:

https://github.com/cli/oauth/blob/6b1e71c3614ec61205f1ffc9964b06dd61221385/api/form.go#L95

I think if it could accept JSON, then other OAuth servers, like Microsoft identity platform's, would come for free.

Thoughts?

mislav commented 3 years ago

@swinton I think that would be a great addition! Thanks for your patience waiting for my reply— I was away some of that time on vacation.

Could you look at our open PRs and check if any address the functionality needed for what you're describing, or should it be a new PR?

swinton commented 3 years ago

Thanks @mislav ...

Could you look at our open PRs and check if any address the functionality needed for what you're describing, or should it be a new PR?

Actually, https://github.com/cli/oauth/pull/7 looks promising :+1:

mislav commented 1 year ago

Closing as the referenced PR got merged and JSON support got added.