diff --git a/src/GaryJones/OAuth/NullToken.php b/src/GaryJones/OAuth/NullToken.php new file mode 100644 index 0000000..b158bcc --- /dev/null +++ b/src/GaryJones/OAuth/NullToken.php @@ -0,0 +1,35 @@ + + * @license https://raw.github.com/GaryJones/OAuth/master/LICENSE MIT + * @link https://github.com/GaryJones/OAuth + */ + +namespace GaryJones\OAuth; + +/** + * Token holds the properties of a single token. + * + * This class deals with both temporary (request) and token (access) credntials. + * + * @package OAuth + * @author Gary Jones + */ +class NullToken extends Token +{ + /** + * Constructs a new client object and populates the required parameters. + * + * @param string $key Client key / identifier. + * @param string $secret Client shared-secret. + */ + public function __construct() + { + $this->setKey(''); + $this->setSecret(''); + } +} diff --git a/src/GaryJones/OAuth/Server.php b/src/GaryJones/OAuth/Server.php index 7ed4ea3..f727057 100644 --- a/src/GaryJones/OAuth/Server.php +++ b/src/GaryJones/OAuth/Server.php @@ -88,7 +88,7 @@ class Server $client = $this->getClient($request); // no token required for the initial token request - $token = null; + $token = new NullToken; $this->checkSignature($request, $client, $token);