Skip to content

Commit

Permalink
fix: update accounts.google.com authorization URI (#2275)
Browse files Browse the repository at this point in the history
  • Loading branch information
niallkennedy authored Oct 27, 2022
1 parent 88cc63c commit b2624d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Client
const USER_AGENT_SUFFIX = "google-api-php-client/";
const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke';
const OAUTH2_TOKEN_URI = 'https://oauth2.googleapis.com/token';
const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/v2/auth';

This comment has been minimized.

Copy link
@Alifarss

Alifarss Dec 18, 2022

نعم

const API_BASE_PATH = 'https://www.googleapis.com';

/**
Expand Down
10 changes: 5 additions & 5 deletions tests/Google/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function testCreateAuthUrl()
$client->setLoginHint('[email protected]');

$authUrl = $client->createAuthUrl("http://googleapis.com/scope/foo");
$expected = "https://accounts.google.com/o/oauth2/auth"
$expected = "https://accounts.google.com/o/oauth2/v2/auth"
. "?response_type=code"
. "&access_type=offline"
. "&client_id=clientId1"
Expand All @@ -176,7 +176,7 @@ public function testCreateAuthUrl()
$client->setPrompt('select_account');
$client->setIncludeGrantedScopes(true);
$authUrl = $client->createAuthUrl("http://googleapis.com/scope/foo");
$expected = "https://accounts.google.com/o/oauth2/auth"
$expected = "https://accounts.google.com/o/oauth2/v2/auth"
. "?response_type=code"
. "&access_type=offline"
. "&client_id=clientId1"
Expand Down Expand Up @@ -233,7 +233,7 @@ public function testPrepareService()
$this->assertEquals("http://test.com scope2", $scopes);
$this->assertEquals(
''
. 'https://accounts.google.com/o/oauth2/auth'
. 'https://accounts.google.com/o/oauth2/v2/auth'
. '?response_type=code'
. '&access_type=online'
. '&client_id=test1'
Expand Down Expand Up @@ -383,7 +383,7 @@ public function testJsonConfig()
// Device config
$client = new Client();
$device =
'{"installed":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret"'.
'{"installed":{"auth_uri":"https://accounts.google.com/o/oauth2/v2/auth","client_secret"'.
':"N0aHCBT1qX1VAcF5J1pJAn6S","token_uri":"https://oauth2.googleapis.com/token",'.
'"client_email":"","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","oob"],"client_x509_cert_url"'.
':"","client_id":"123456789.apps.googleusercontent.com","auth_provider_x509_cert_url":'.
Expand All @@ -396,7 +396,7 @@ public function testJsonConfig()

// Web config
$client = new Client();
$web = '{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret"' .
$web = '{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/v2/auth","client_secret"' .
':"lpoubuib8bj-Fmke_YhhyHGgXc","token_uri":"https://oauth2.googleapis.com/token"' .
',"client_email":"[email protected]","client_x509_cert_url":'.
'"https://www.googleapis.com/robot/v1/metadata/x509/[email protected]"'.
Expand Down

2 comments on commit b2624d2

@Alifarss
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alifarss
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.