Skip to content

proposal: x/oauth2: support Refresh Token Request with Custom Parameters #61594

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
andig opened this issue Jul 26, 2023 · 2 comments
Closed

proposal: x/oauth2: support Refresh Token Request with Custom Parameters #61594

andig opened this issue Jul 26, 2023 · 2 comments
Labels
Milestone

Comments

@andig
Copy link
Contributor

andig commented Jul 26, 2023

Migrated from golang/oauth2#521, refs #56402 (comment)

We'd like to be able to add custom parameters to the Refresh Token Request provided by the configuration client.

Proposed solution:

Add optional parameters to oauth2.Config.TokenSource() similar to SetAuthURLParam. This pattern could later be extended for headers if necessary.

Proposed API:

type TokenSourceOption func(*reuseTokenSource)
func (c *Config) TokenSource(ctx context.Context, t *Token, opts ...TokenSourceOption) TokenSource

Would be happy to try a CL.

Consequence of not implementing:

Custom unmarshaling of oauth2.Token (see #61417) or custom token refreshers (see https://github.com/evcc-io/evcc/blob/master/util/oauth/tokensource.go#L12)

Alternatives:

To some extend #61417 but still at cost of additional code.

@andig andig added the Proposal label Jul 26, 2023
@gopherbot gopherbot added this to the Proposal milestone Jul 26, 2023
@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals Jul 27, 2023
@seankhliao
Copy link
Member

Not a backwards compatible change.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2025
@andig
Copy link
Contributor Author

andig commented Apr 18, 2025

@seankhliao that's unfortunate. Is there any alternative? Could we add an additional method, maybe TokenSourceWithOptions, similar to TokenSourceWithExpiry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

3 participants