yup-oauth2 icon indicating copy to clipboard operation
yup-oauth2 copied to clipboard

Add a noninteractive authenticator

Open sean-purcell opened this issue 3 years ago • 4 comments

This pair of commits adds another authenticator, which is guaranteed to be non-interactive and just uses stored refresh tokens obtained from a previous authenticator. I want to use this in an offline job that I run periodically, which I build once using a helper binary to generate the NoninteractiveTokens, and then can use repeatedly. This authenticator is simple and guaranteed to just error out if it can't provide tokens, instead of trying to do something interactive.

sean-purcell avatar Aug 14 '21 23:08 sean-purcell

Hi, may I know if there is any follow up on this feature, or at least a temporary workaround?

habibialkaff avatar Feb 19 '22 11:02 habibialkaff

Hi, may I know if there is any follow up on this feature, or at least a temporary workaround?

Good point, I'm sorry for not having come back to this. It looks like a useful addition, and I'd merge it once the conflicts are resolved!

dermesser avatar Feb 22 '22 18:02 dermesser

Is there a difference between this NonInteractive authenticator and an InstalledFlowAuthenticator with a InstalledFlowDelegate that always returns an error in InstalledFlowDelegate::present_user_url?

ggriffiniii avatar Feb 22 '22 20:02 ggriffiniii

Is there a difference between this NonInteractive authenticator and an InstalledFlowAuthenticator with a InstalledFlowDelegate that always returns an error in InstalledFlowDelegate::present_user_url?

I think in principle it would have the same effect. I find this flow slightly more transparent and could see some use cases for this, even though the effect would be the same when using an appropriately implemented InstalledFlowDelegate.

dermesser avatar Feb 22 '22 20:02 dermesser