Re: KeyError: 'refresh_token' error in fetchmail-oauth2

Robin Atwood <[email protected]> Sun, 24 Apr 2022 21:36:44 +0700
Newsgroups gmane.mail.fetchmail.user
Message-ID <[email protected]>
On Sun, 24 Apr 2022 11:38:50 +0200
"J.Edner" <[email protected]> wrote:

> Hello Marco,
> 
> >> Juergen Edner say that the OAuth client created in 'Test mode'
> >> least at maximum a week.
> >> But if i try to publish the app, i need the Google approval
> >> process, because the api used (eg, GMAIL API) is 'restricted'.
> >> So, it is needed to publish the app? If yes, what is the shortest
> >> and error prone path to get it approved?  
> > 
> > OK, i can confirm Juergen is true; after 7 days:
> > 
> >   /home/famiglia/fetchmail-oauth2.py -c /home/famiglia/.oauth2.conf
> > --auto_refresh Traceback (most recent call last):
> >     File "/home/famiglia/fetchmail-oauth2.py", line 591, in <module>
> >       main(sys.argv)
> >     File "/home/famiglia/fetchmail-oauth2.py", line 502, in main
> >       newTok = response['access_token']
> >   KeyError: 'access_token'
> > 
> > I've redone the auth with '--obtain_refresh_token_file' and now
> > works back as usual.
> > 
> > 
> > I perfectly agree that big G is not fair on this, but... more
> > practically, how can i 'register' a (fake?) fetcmail app?  
> 
> In general there is not always a requirement to get your application
> verified by Google, if you set the status to "external" and 
> "production". This was one of the most irritating facts for me too,
> as I configured Fetchmail OAuth2 access for the first time. These are
> the verification rules:
> 
>    Verification Status
>    -------------------
>    Google verifies projects configured for a user type of External and
>    a publishing status of In production if they meet one or more of
> the OAuth verification criteria:
> 
>    * You want to display an icon or display name for your project on
> the OAuth consent screen.
>    * Your project's OAuth clients request authorization of any
> sensitive or restricted scopes.
>    * The number of authorized domains for your project exceeds the
> domain count limit.
>    * There are changes to your project's OAuth consent screen
>      configuration after a previous published, verified configuration.
> 
> Regards
> Juergen

Juergen -
I tried publishing my "fetchmail" app but when I do the "oauth2
--obtain_refresh_token_file" step, I get an HTTP 400 error from Google.
So what's the simplest way to resolve this? Create a display name? Is
that possible without creating yet another app?

Thanks
Robin
-- 
----------------------------------------------------------------------
Robin Atwood.

"Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst"
         from "Mandalay" by Rudyard Kipling
----------------------------------------------------------------------