Merged in victorsl/processmaker/PM-2112 (pull request #1905)
PM-2112 "0016986: REST endpoint PUT /{workspace}/oauth2/token sets.." SOLVED
This commit is contained in:
@@ -204,7 +204,7 @@ class Server implements iAuthenticate
|
|||||||
$clientId = $_GET['client_id'];
|
$clientId = $_GET['client_id'];
|
||||||
$requestedScope = isset($_GET['scope']) ? $_GET['scope'] : '*';
|
$requestedScope = isset($_GET['scope']) ? $_GET['scope'] : '*';
|
||||||
$requestedScope = empty($requestedScope) ? array() : explode(' ', $requestedScope);
|
$requestedScope = empty($requestedScope) ? array() : explode(' ', $requestedScope);
|
||||||
$client = $this->storage->getClientDetails($clientId);;
|
$client = $this->storage->getClientDetails($clientId);
|
||||||
|
|
||||||
if (empty($client)) {
|
if (empty($client)) {
|
||||||
// throw error, client does not exist.
|
// throw error, client does not exist.
|
||||||
@@ -308,10 +308,20 @@ class Server implements iAuthenticate
|
|||||||
|
|
||||||
if ($returnResponse) {
|
if ($returnResponse) {
|
||||||
return $response;
|
return $response;
|
||||||
|
} else {
|
||||||
|
if ($response->getStatusCode() == 400) {
|
||||||
|
$msg = $response->getParameter("error_description", "");
|
||||||
|
$msg = ($msg != "")? $msg : $response->getParameter("error", "");
|
||||||
|
|
||||||
|
$rest = new \Maveriks\Extension\Restler();
|
||||||
|
$rest->setMessage(new \Luracast\Restler\RestException(\ProcessMaker\Services\Api::STAT_APP_EXCEPTION, $msg));
|
||||||
|
|
||||||
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
$response->send();
|
$response->send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access verification method.
|
* Access verification method.
|
||||||
|
|||||||
Reference in New Issue
Block a user