diff --git a/Client/OAuth2Client.php b/Client/OAuth2Client.php index f4114bd4..7f896d0e 100644 --- a/Client/OAuth2Client.php +++ b/Client/OAuth2Client.php @@ -45,7 +45,7 @@ public function redirect(array $scopes = array()) { $options = array(); if (!empty($scopes)) { - $options['scopes'] = $scopes; + $options['scope'] = $scopes; } $url = $this->provider->getAuthorizationUrl($options); diff --git a/Tests/Client/OAuth2ClientTest.php b/Tests/Client/OAuth2ClientTest.php index 0524162f..58f37750 100644 --- a/Tests/Client/OAuth2ClientTest.php +++ b/Tests/Client/OAuth2ClientTest.php @@ -28,7 +28,7 @@ public function setup() public function testRedirectWithState() { - $this->provider->getAuthorizationUrl(['scopes' => ['scope1', 'scope2']]) + $this->provider->getAuthorizationUrl(['scope' => ['scope1', 'scope2']]) ->willReturn('http://coolOAuthServer.com/authorize'); $this->provider->getState() ->willReturn('SOME_RANDOM_STATE');