From 927d1dc838821c4edf92b8eb619b4041e8e2a3c4 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 6 Jul 2012 19:21:50 +0100 Subject: [PATCH] Added generateCode function --- src/oauth2server/Server.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/oauth2server/Server.php b/src/oauth2server/Server.php index e336fcf0..836145ba 100644 --- a/src/oauth2server/Server.php +++ b/src/oauth2server/Server.php @@ -173,6 +173,19 @@ class Server return $params; } + /** + * Generates a unique code + * + * Generate a unique code for an authorisation code, or token + * + * @access public + * @return string + */ + private function generateCode() + { + return sha1(uniqid(microtime())); + } + public function newAuthCode(string $clientId, $type = 'user', string $typeId, string $redirectUri, $scopes = array(), string $access_token = null)