diff --git a/src/GoogleAPI/GoogleAPIClient.php b/src/GoogleAPI/GoogleAPIClient.php index f7c8865..7e03f0f 100644 --- a/src/GoogleAPI/GoogleAPIClient.php +++ b/src/GoogleAPI/GoogleAPIClient.php @@ -90,6 +90,7 @@ public function authenticate( $this->client->setApplicationName('Forikal Tools'); $this->client->setScopes($scopes); $this->client->setAccessType('offline'); + $this->client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob'); $this->logger->info('Getting the Google API client secret from the `'.$clientSecretFile.'` file'); $this->client->setAuthConfig($this->loadCredentialJSON($clientSecretFile)); diff --git a/tests/GoogleAPI/GoogleAPIClientTest.php b/tests/GoogleAPI/GoogleAPIClientTest.php index 5a909ab..a5126c9 100644 --- a/tests/GoogleAPI/GoogleAPIClientTest.php +++ b/tests/GoogleAPI/GoogleAPIClientTest.php @@ -48,6 +48,7 @@ protected function setUp() ->getMock(); $this->googleClientMock->method('setApplicationName')->with('Forikal Tools'); $this->googleClientMock->method('setAccessType')->with('offline'); + $this->googleClientMock->method('setRedirectUri'); $this->loggerMock = $this->createMock(LoggerInterface::class); }