From dbe21cc5a719a62d5f10abbd30da745f832e1fef Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Wed, 8 May 2013 19:36:00 -0700 Subject: [PATCH 1/4] Removed null as default for parameters --- src/League/OAuth2/Server/Grant/AuthCode.php | 2 +- src/League/OAuth2/Server/Storage/ClientInterface.php | 2 +- src/League/OAuth2/Server/Storage/PDO/Client.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/League/OAuth2/Server/Grant/AuthCode.php b/src/League/OAuth2/Server/Grant/AuthCode.php index 9770c929..9ea1e9da 100644 --- a/src/League/OAuth2/Server/Grant/AuthCode.php +++ b/src/League/OAuth2/Server/Grant/AuthCode.php @@ -127,7 +127,7 @@ class AuthCode implements GrantTypeInterface { } // Validate client ID and redirect URI - $clientDetails = $this->authServer->getStorage('client')->getClient($authParams['client_id'], null, $authParams['redirect_uri']); + $clientDetails = $this->authServer->getStorage('client')->getClient($authParams['client_id'], null, $authParams['redirect_uri'], $this->identifier); if ($clientDetails === false) { throw new Exception\ClientException($this->authServer->getExceptionMessage('invalid_client'), 8); diff --git a/src/League/OAuth2/Server/Storage/ClientInterface.php b/src/League/OAuth2/Server/Storage/ClientInterface.php index d21ecfab..b98da03d 100644 --- a/src/League/OAuth2/Server/Storage/ClientInterface.php +++ b/src/League/OAuth2/Server/Storage/ClientInterface.php @@ -53,5 +53,5 @@ interface ClientInterface * @param string $grantType The grant type used in the request * @return bool|array Returns false if the validation fails, array on success */ - public function getClient($clientId = null, $clientSecret = null, $redirectUri = null, $grantType = null); + public function getClient($clientId, $clientSecret = null, $redirectUri = null, $grantType); } \ No newline at end of file diff --git a/src/League/OAuth2/Server/Storage/PDO/Client.php b/src/League/OAuth2/Server/Storage/PDO/Client.php index fa1f3986..ced1a3ca 100644 --- a/src/League/OAuth2/Server/Storage/PDO/Client.php +++ b/src/League/OAuth2/Server/Storage/PDO/Client.php @@ -6,7 +6,7 @@ use League\OAuth2\Server\Storage\ClientInterface; class Client implements ClientInterface { - public function getClient($clientId = null, $clientSecret = null, $redirectUri = null, $grantType = null) + public function getClient($clientId, $clientSecret = null, $redirectUri = null, $grantType) { $db = \ezcDbInstance::get(); From 6b686a96e749890a6118d3f2b90b5ca5a3c98d19 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Wed, 8 May 2013 19:37:19 -0700 Subject: [PATCH 2/4] Updated tutorial links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6824d544..ab5866b2 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,9 @@ If you are using MySQL and want to very quickly implement the library then all o ## Tutorials -A tutorial on how to use the authorization server can be found at [http://alexbilbie.com/2013/02/developing-an-oauth2-authorization-server/](http://alexbilbie.com/2013/02/developing-an-oauth2-authorization-server/). +A tutorial on how to use the authorization server can be found on the wiki - (https://github.com/php-loep/oauth2-server/wiki/Developing-an-OAuth-2.0-authorization-server)[https://github.com/php-loep/oauth2-server/wiki/Developing-an-OAuth-2.0-authorization-server]. -A tutorial on how to use the resource server to secure an API server can be found at [http://alexbilbie.com/2013/02/securing-your-api-with-oauth-2/](http://alexbilbie.com/2013/02/securing-your-api-with-oauth-2/). +A tutorial on how to use the resource server to secure an API server can be found at [https://github.com/php-loep/oauth2-server/wiki/Securing-your-API-with-OAuth-2.0](https://github.com/php-loep/oauth2-server/wiki/Securing-your-API-with-OAuth-2.0). ## Future Goals From 561bda71a99a0dc406856e9fc06764b2c5716e8f Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Wed, 8 May 2013 19:38:23 -0700 Subject: [PATCH 3/4] Link to wiki --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab5866b2..efe36404 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,9 @@ Custom grants can be created easily by implementing an interface. Check out a gu If you are using MySQL and want to very quickly implement the library then all of the storage interfaces have been implemented with PDO classes. Check out the guide here [https://github.com/php-loep/oauth2-server/wiki/Using-the-PDO-storage-classes](https://github.com/php-loep/oauth2-server/wiki/Using-the-PDO-storage-classes). -## Tutorials +## Tutorials and documentation + +The wiki has lots of guides on how to use this library, check it out - [https://github.com/php-loep/oauth2-server/wiki](https://github.com/php-loep/oauth2-server/wiki). A tutorial on how to use the authorization server can be found on the wiki - (https://github.com/php-loep/oauth2-server/wiki/Developing-an-OAuth-2.0-authorization-server)[https://github.com/php-loep/oauth2-server/wiki/Developing-an-OAuth-2.0-authorization-server]. From f2f99b429f7cae4d46a3881f25a06be399f391bc Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Wed, 8 May 2013 19:39:15 -0700 Subject: [PATCH 4/4] Version bump --- composer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index fa4bf547..6e98fa7f 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "league/oauth2-server", "description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.", - "version": "2.0", + "version": "2.0.2", "homepage": "https://github.com/php-leop/oauth2-server", "license": "MIT", "require": { @@ -35,7 +35,8 @@ } ], "replace": { - "lncd/oauth2": "*" + "lncd/oauth2": "*", + "league/oauth2server": "*" }, "autoload": { "psr-0": {