There is some support for a configurable token source 
in https://github.com/golang/oauth2/pull/448#issuecomment-835811792, no 
feedback otherwise.

Cheers,
Andi

On Thursday, April 22, 2021 at 6:10:38 PM UTC+2 cpu...@gmail.com wrote:

> After working with a few more-or-less OAuth2 APIs lately, I would like to 
> propose slightly extending the API footprint of the oauth2 library. 
>
> By doing so I expect that the amount of userland/provider-specific code 
> can be reduced- both inside oauth2 and outside in realworld applications. 
> Some of the ideas have been proposed in 
> https://github.com/golang/oauth2/issues/483 and 
> https://github.com/golang/oauth2/issues/484.
>
> Most notably, it would be nice if OAuth2 could cater for the following 
> situations:
> - OAuth2 tokens with `expires_in` field (already handled by internal and 
> in some of the OAuth2 providers)
> - Add a `TokenRefresher` interface (currently implemented by 
> `tokenRefresher`) that can be passed to a `ReuseTokenSource` for performing 
> the actual token refresh to allow more flexible refresh scenarios.
>
> With these two changes, x/oauth2 could be more widely used without need 
> for reimplementation of the above parts plus might deduplicate parts of the 
> implemented providers.
>
> Hope the above points make sense, happy to take feedback.
>
> Cheers,
> Andi
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d1cfce97-7b7e-4d8d-8b84-e28e221d91f2n%40googlegroups.com.

Reply via email to