I am using the Google API Client to access Google Analytics. I want to access the data in offline mode, so I need a refresh token. How do I get a refresh_token?
相关问题
- Obtaining Refresh Token from lepture/Authlib throu
- YouTube API refresh token revoked with 400 code “i
- Azure AD OAuth client credentials grant flow with
- Authenticating to Google Cloud Endpoints as iOS ap
- Set API key with embed API google analytics
相关文章
- Why is redirect_uri required on Access Token reque
- Django REST Framework - OAuth2 Consumer API from e
- Google OAuth 2.0 User id datatype for MYSQL
- Google OAuth 2: response_type error on token reque
- Google OAuth 2 redirect_uri_mismatch - OmniAuth Ra
- Profiling the Performance of a Google App Script
- Google Chrome extension: How to find out if a user
- Implementing social login in asp.net core 2.2 with
For PHP SDK of Google Client v2:
You can try the PHP code to refresh accessToken as following:
Offline access issue
In addition, if you want to keep the existing behavior in your server-side applications, you need to set
approval_prompt
toforce
, otherwise you may get NULL returned from getRefreshToken(), which Google document doesn't mention:try using the following code: