oauth2 icon indicating copy to clipboard operation
oauth2 copied to clipboard

add passwordcredentials client like clientcredentials

Open josephholsten opened this issue 8 years ago • 18 comments

https://go-review.googlesource.com/c/23834/

In order to use PasswordCredentialsToken, a TokenSource needs to be provided. It's not complicated to have one of these readily available, in the style of golang.org/x/oauth2/clientcredentials.

It would also be good to have #146, which would fix #110.

josephholsten avatar Jun 01 '16 00:06 josephholsten

~~CL in http://golang.org/cl/23611/~~ updated CL: http://golang.org/cl/23834/

josephholsten avatar Jun 01 '16 00:06 josephholsten

needs tests and doc

josephholsten avatar Jun 01 '16 00:06 josephholsten

Tests done, doc needs review

josephholsten avatar Jun 01 '16 01:06 josephholsten

doc should be ready

josephholsten avatar Jun 02 '16 18:06 josephholsten

reverted by https://go-review.googlesource.com/#/c/23841/, apparently this requires more discussion

josephholsten avatar Jun 07 '16 06:06 josephholsten

@rakyll I added another comment to the CL, you made a great point. That's how I ended up submitting this. This "reimplements" https://godoc.org/golang.org/x/oauth2#Config.PasswordCredentialsToken using the same implementation pattern from https://godoc.org/golang.org/x/oauth2/clientcredentials, because using PasswordCredentialsToken as is requires implementing a wrapper TokenSource.

I'm planning to make a CL reimplementing this using Config.PasswordCredentialsToken. That was how I started in my local fork and didn't like it as much. I don't know if/how to re-open this CL, but I still think it's the most reasonable.

josephholsten avatar Jun 07 '16 06:06 josephholsten

This CL is still pending, right? https://go-review.googlesource.com/c/23834/

adg avatar Nov 03 '16 20:11 adg

Even though we promised not to break any APIs, I am suggesting to remove the Config.PasswordCredentialsToken if we merge the passwordcredentials package. I do not think the current API is widely used and keeping the library orthogonal is more valuable than breaking a few users.

rakyll avatar Nov 03 '16 21:11 rakyll

Yes, I am still using this approach locally. I'm still interested in this CL.

josephholsten avatar Nov 04 '16 21:11 josephholsten

@adg is there anything I need to do to move this forward?

josephholsten avatar Nov 16 '16 19:11 josephholsten

@rakyll what do you think?

adg avatar Nov 18 '16 00:11 adg

I am in favor of adding a deprecation notice to https://godoc.org/golang.org/x/oauth2#Config.PasswordCredentialsToken and go with @josephholsten's package.

rakyll avatar Nov 18 '16 01:11 rakyll

@rakyll @adg anything you'd like me to do?

josephholsten avatar Feb 23 '17 00:02 josephholsten

What @rakyll suggests sounds good to me. Whoever wants to do that can do it.

adg avatar Feb 23 '17 01:02 adg

@josephholsten, I left comments on your change at https://go-review.googlesource.com/c/23834/ a while ago. Can you take a look at those?

rakyll avatar Feb 23 '17 01:02 rakyll

@rakyll sorry, I hadn't pushed my changes when I made that comment. Care to give it another look?

josephholsten avatar Feb 27 '17 15:02 josephholsten

I would like to use this package, is this every going to move forward?

smitt04 avatar Sep 09 '21 03:09 smitt04

For anyone who is interested, a couple of years ago I extracted this PR into a package that you can use to provide the required functionality, pending the merge of this PR: https://github.com/joefitzgerald/passwordcredentials

joefitzgerald avatar Apr 06 '24 20:04 joefitzgerald