Skip to content
Snippets Groups Projects
Commit 26b01c7f authored by Vincent Petry's avatar Vincent Petry
Browse files

Force approval in GDrive oauth to get refresh_token

Forcing the approval of app permissions makes sure that the GDrive API
will always return a refresh_token.

In the case of apps that were already authorized for the current user/domain,
the API doesn't return the refresh_token which causes expiration issues.
parent 6e7411fc
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST ...@@ -41,6 +41,7 @@ if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST
$client->setClientSecret((string)$_POST['client_secret']); $client->setClientSecret((string)$_POST['client_secret']);
$client->setRedirectUri((string)$_POST['redirect']); $client->setRedirectUri((string)$_POST['redirect']);
$client->setScopes(array('https://www.googleapis.com/auth/drive')); $client->setScopes(array('https://www.googleapis.com/auth/drive'));
$client->setApprovalPrompt('force');
$client->setAccessType('offline'); $client->setAccessType('offline');
if (isset($_POST['step'])) { if (isset($_POST['step'])) {
$step = $_POST['step']; $step = $_POST['step'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment