Refresh Token expire in 7 days

850 views
Skip to first unread message

Mary Shiya Shaji

unread,
Jan 30, 2025, 2:55:55 AM1/30/25
to Google Ads API and AdWords API Forum
Hi,
I am using Google ads APIs, and I use OAuth 2.0 for authentication. the refresh token of OAuth 2.0 expire after 7 days. My OAuth consent screen is currently in "Testing" status. If I change it to "Production" and verify my app in Google cloud platform, will the refresh tokens remain valid indefinitely, or will they expire after a certain period? If they do expire, how long will they remain valid?.

Regards,
Mary Shiya

Google Ads API Forum Advisor

unread,
Jan 30, 2025, 5:46:54 AM1/30/25
to shiyas...@gmail.com, adwor...@googlegroups.com
Hi Mary,

Thank you for reaching out to the Google Ads API support team.

If you use the OAuth Playground to generate a refresh token, it will automatically revoke refresh tokens after 24h. Also, you may refer to this document to read more information about refresh token expiration. If you set the publishing status to "Testing" so the refresh token expires every 7 days and receives an “invalid_grant” error. That being said, please go to the Google API Console and navigate to the OAuth consent screen and then change the publishing status to “In production” to avoid the refresh token expiring in 7 days. 

By default, our client libraries automatically refresh expired access tokens. You may refer to this guide on 'Fetch a refresh token', which uses the oauth2l command instead of curl to fetch the OAuth 2.0 refresh tokens. Another option for generating OAuth2 credentials is to use the OAuth2 Playground. The OAuth2 Playground, in conjunction with the Google API Console, lets you manually create OAuth2 tokens.

I hope this helps! Let us know if you have any further questions. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGz6v:ref" (ADR-00286391)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Reply all
Reply to author
Forward
0 new messages