Expiry of Refresh Token / Access Token

7,450 views
Skip to first unread message

K Raza

unread,
Mar 14, 2021, 1:18:11 AM3/14/21
to AdWords API and Google Ads API Forum
My google ads token expired after a week.   Can I generate a long life token for server side app?

Google Ads API Forum Advisor Prod

unread,
Mar 15, 2021, 1:01:31 PM3/15/21
to kalimr...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. You can use a refresh token to automatically renew OAuth2 access in your application. Please let us know if you have any other questions on this. 

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DvQWg:ref

Ngô Minh Tùng

unread,
Mar 15, 2021, 10:07:11 PM3/15/21
to adsapifor...@gmail.com, kalimr...@gmail.com, adwor...@googlegroups.com
Hi all, I have the same problems
I used response_type that is code and get code param on this response. 
After that, I use grant_type that is authorization_code and code params to get refresh_token. But token expire after some days
How i can get the new token via refesh_token or code i have, for server side access resource long life without interaction of end users,

Vào Th 3, 16 thg 3, 2021 vào lúc 00:01 Google Ads API Forum Advisor Prod <adsapifor...@gmail.com> đã viết:
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/1FPEQ000000000000000000000000000000000000000000000QQ0SM500YlhO4ls2QCWuMBcPemJeHQ%40sfdc.net.


--
Ngô Minh Tùng | Student of FPT University
Phone:  0168 372 4638 | Email: minhtu...@gmail.com
Address: Phú Cát, Quốc Oai, Hà Nội

Google Ads API Forum Advisor Prod

unread,
Mar 16, 2021, 11:22:31 AM3/16/21
to minhtu...@gmail.com, kalimr...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. Here are some common causes for the refresh token expiration. It seems that you were issued a refresh token expiring in 7 days as you configured the OAuth consent screen section of the Cloud Platform project with an external user type and a publishing status of "Testing". You could change the publishing status to production to avoid this issue. 

Thanks and regards,
Xiaoming, Google Ads API Team
 

Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DvQWg:ref

Endrit Hoti

unread,
Jan 24, 2023, 9:47:28 AM1/24/23
to Google Ads API and AdWords API Forum
Hello, I have same problem now. My app in cloud platform is external user type and publishing status "Production" and still the problem with refresh token persists.

it says :
google.auth.exceptions.RefreshError: (‘invalid_client: Unauthorized’, {‘error’: ‘invalid_client’, ‘error_description’: ‘Unauthorized’})


All the best, Endrit

Google Ads API Forum Advisor

unread,
Jan 24, 2023, 10:30:52 AM1/24/23
to endrit...@gmail.com, adwor...@googlegroups.com
Hi Endrit,

Thank you for reaching out to our API support team.

The invalid_client is different from the invalid_grant (usually due to expired refresh tokens) error.

That said, the invalid_client could indicate an issue with your credentials (client_id and client_secret) and we recommend that you regenerate these by following once more our OAuth2 setup guide.

Let us know how this goes.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5004Q2DvQWg:ref
Reply all
Reply to author
Forward
0 new messages