diff --git a/README.md b/README.md index 6824d544..efe36404 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,13 @@ 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 -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/). +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 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 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 [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 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": { 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();