Search code examples
pythongoogle-chrome-extensionoauth-2.0google-oauthgoogle-cloud-messaging

Is it possible to get refresh token from Google without running a server on my VPS?


I need refresh token so that I can send messages to registered Chrome browsers using GCM. However most of the tutorials I consulted require a server to be running at my side and I have to do everything manually, open the auth url, authenticate it and get redirected to my server to get refresh token.

I was hoping if there is a way to do this without running a server at my side. Is it possible to get refresh token just using client id and client secret?

Once I get a refresh token I have to do a POST to GCM server to send notifications.


Solution

  • You can not get refresh token just using client_id and client_secret. Only in authorization code flow, refresh token is issued. Good news is refresh token will not be expire until user revoke it, so you can use it for a long long time. So you can once get it and use it. In authorization code flow, you need a server to get redirected tokens.