Google API Oauth - refresh tokens?

Mike Kerner MikeKerner at roadrunner.com
Mon Aug 3 14:17:28 EDT 2020


I'm pretty sure that refresh tokens are used with service accounts (the
account has its own authorization so that it can do things, but it does not
have its own storage or documents).  Authentication is more involved,
including, for instance, generating a JWT which has to be built and sent to
Google during the authorization process to obtain the access token, and
then hourly to obtain the refresh token.  I never got the JWT signed
properly, and I haven't played with it since we got this process working in
another tool that we use.
I'd be interested in seeing your code when you're done.

On Thu, Jul 30, 2020 at 5:09 PM Ben Rubinstein via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Back in 2018 when I was originally working with Google sheets, the OAuth
> authorisation once granted seemed to refresh automatically.
>
> That is, if a call returned the 'unauthorised' error, calling OAuth with
> the
> same parameters would briefly display a sheet dialog, but it would go away
> automatically.
>
> Then I finished working on that project, and when six months I briefly
> looked
> at this again, fell victim to bug #22557.
>
> Now that this is fixed, I'm happily working with the system again (and
> will
> shortly release my code in case it's of use to anyone) - but now when the
> authorisation expires (which is does after an hour or so), calling Oauth2
> goes
> through the process requiring user activity.
>
> There's an OAuth2Refresh command in LiveCode; but the issue is that I
> don't
> get a refresh token from the Google API. From my reading of the docs, only
> certain kinds of app registered with Google get refresh tokens - but I
> don't
> seem to be able to figure this out.
>
> Has anyone managed to register an app with Google (in
> https://console.developers.google.com/apis/) in a way that means it gets
> refresh tokens?
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list