summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CloudFile/src')
-rw-r--r--plugins/CloudFile/src/Services/microsoft_api.h7
-rw-r--r--plugins/CloudFile/src/Services/microsoft_service.cpp5
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/CloudFile/src/Services/microsoft_api.h b/plugins/CloudFile/src/Services/microsoft_api.h
index 3dcb34e2ba..5c8abafeb3 100644
--- a/plugins/CloudFile/src/Services/microsoft_api.h
+++ b/plugins/CloudFile/src/Services/microsoft_api.h
@@ -35,9 +35,10 @@ namespace OneDriveAPI
{
AddHeader("Content-Type", "application/x-www-form-urlencoded");
- CMStringA data(CMStringDataFormat::FORMAT,
- "client_id=%s&grant_type=refresh_token&refresh_token=%s",
- MS_APP_ID, refreshToken);
+ CMStringA data = "redirect_uri=https://oauth.miranda-ng.org/verification";
+ data.Append("&scope=offline_access https://graph.microsoft.com/files.readWrite");
+ data.AppendFormat("&client_id=%s&client_secret=%s", MS_APP_ID, MS_CLIENT_SECRET);
+ data.AppendFormat("&grant_type=refresh_token&refresh_token=%s", refreshToken);
SetData(data.GetBuffer(), data.GetLength());
}
};
diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp
index af4ebe2439..4fe9066c22 100644
--- a/plugins/CloudFile/src/Services/microsoft_service.cpp
+++ b/plugins/CloudFile/src/Services/microsoft_service.cpp
@@ -37,15 +37,14 @@ bool COneDriveService::IsLoggedIn()
if (!token || token[0] == 0)
return false;
time_t now = time(nullptr);
- time_t expiresIn = getWord("ExpiresIn");
+ time_t expiresIn = getDword("ExpiresIn");
return now < expiresIn;
}
void COneDriveService::Login()
{
- ptrA token(getStringA("TokenSecret"));
ptrA refreshToken(getStringA("RefreshToken"));
- if (token && refreshToken && refreshToken[0]) {
+ if (refreshToken && refreshToken[0]) {
OneDriveAPI::RefreshTokenRequest request(refreshToken);
NLHR_PTR response(request.Send(m_hConnection));