update API

revert bad merge

fix cs
This commit is contained in:
Nicolas Le Goff
2012-07-06 20:10:21 +02:00
parent 9ab4e0c1c4
commit b4ff14f3e4
6 changed files with 123 additions and 165 deletions

View File

@@ -168,19 +168,6 @@ class API_OAuth2_Adapter extends OAuth2
return $this->usr_id;
}
/**
*
* @param string $secret
* @param string $nonce
* @return string
*/
protected static function crypt_secret($secret, $nonce)
{
$registry = registry::get_instance();
return hash_hmac('sha512', $secret . $nonce, $registry->get('GV_sit'));
}
/**
*
* Implements OAuth2::checkClientCredentials().
@@ -198,9 +185,7 @@ class API_OAuth2_Adapter extends OAuth2
return true;
}
$crypted = $this->crypt_secret($client_secret, $application->get_nonce());
return ($result["client_secret"] === $crypted);
return ($application->get_client_secret() === $client_secret);
} catch (Exception $e) {
}