Adicion de END POINTS para tokens (EXPIRE y DELETE)

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-10-28 09:17:54 -04:00
parent 2b61a2fa84
commit 19464fabb0
2 changed files with 44 additions and 0 deletions

View File

@@ -73,6 +73,32 @@ class Server implements iAuthenticate
$this->server->setScopeUtil($scope);
}
/**
* @url POST /:token/expire
*
*/
public function doPostExpireToken($token)
{
try {
$this->storage->expireToken($token);
} catch (\Exception $e) {
throw new RestException(400, $e->getMessage());
}
}
/**
* @url DELETE /:token
*
*/
public function doDeleteToken($token)
{
try {
$this->storage->deleteToken($token);
} catch (\Exception $e) {
throw new RestException(400, $e->getMessage());
}
}
public static function setDatabaseSource($user, $password = '', $dsn = '')
{
if (is_array($user)) {