Requirements for long lived refresh token

We are using Azure Data Factory to load GA4 data and Ads API data to data warehouse. To make the connection we have a Google Cloud project and use its credentials to authenticate.

I have setup ADF so that it will use a refresh token to get a new access token. The problem that im having is that refresh token expires in 7 days.

My understanding is that to expand the refresh token I need to publish the cloud project. I have done this in https://console.cloud.google.com/apis/credentials/consent . Under "Publishing status", I have clicked the "Publish app" button. Its currently showing "In production" and has a button labelled "Back to testing".

Sadly the refresh token still expires in 7 days. What am i missing or doing wrong? Is there some other place to publish the app? 

At the moment i'm using developer playground to generate the refresh token. https://developers.google.com/oauthplayground/

Access token is generated trough https://www.googleapis.com/oauth2/v4/token API call.

1 2 1,458
2 REPLIES 2

Hi @Mefistofeles,

Welcome to the Google Cloud Community!

You are correct that once the Publishing status is in "In Production", tokens shouldn't expire after 7 days. Can you try doing the steps below from this Stack Overflow thread[1]:

  1. Go to https://console.cloud.google.com/apis/credentials/consent and change from the testing status to published.
  2. Delete the current token file.
  3. Authorize the API again by signing into your gmail account. You will be sent to a warning screen. From there, you can choose to proceed.
  4. When done you'll get a new token file

If the above option doesn't work, you can contact Google Cloud Support to further look into your case. Thank you! 😃

[1]. https://stackoverflow.com/questions/66058279/token-has-been-expired-or-revoked-google-oauth2-refresh...

Hello, I also encountered this problem, very distressed, after Posting the status, refresh token really does not expire after seven days?

Top Labels in this Space