diff options
author | aunsane <aunsane@gmail.com> | 2017-04-23 23:07:03 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-04-23 23:14:45 +0300 |
commit | 856629d0e757c73720097fd89d598c097df86c2b (patch) | |
tree | 716255c90dda5538f367d464f0dbbc968b55c3a5 /plugins/CloudFile/src/Services/google_api.h | |
parent | 71a8d5202cc65a6e714956e78852a7b87ce51b35 (diff) |
CloudFile: fix for token refresh
Diffstat (limited to 'plugins/CloudFile/src/Services/google_api.h')
-rw-r--r-- | plugins/CloudFile/src/Services/google_api.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/CloudFile/src/Services/google_api.h b/plugins/CloudFile/src/Services/google_api.h index a48e9e878b..cf405dda36 100644 --- a/plugins/CloudFile/src/Services/google_api.h +++ b/plugins/CloudFile/src/Services/google_api.h @@ -26,6 +26,21 @@ namespace GDriveAPI } }; + class RefreshTokenRequest : public HttpRequest + { + public: + RefreshTokenRequest(const char *refreshToken) : + HttpRequest(REQUEST_POST, "https://www.googleapis.com/oauth2/v4/token") + { + AddHeader("Content-Type", "application/x-www-form-urlencoded"); + + CMStringA data(CMStringDataFormat::FORMAT, + "client_id=%s&client_secret=%s&grant_type=refresh_token&refresh_token=%s", + GOOGLE_APP_ID, GOOGLE_CLIENT_SECRET, refreshToken); + SetData(data.GetBuffer(), data.GetLength()); + } + }; + class RevokeAccessTokenRequest : public HttpRequest { public: |