PM-1873 "RefreshToken not recreated after using it to generate..." SOLVED

Issue:
    RefreshToken not recreated after using it to generate another accessToken
Cause:
    Nuevo requerimiento de funciones
Solution:
    Se esta definiendo el flag "always_issue_new_refresh_token" con "true",
    esto para poder generar un nuevo refresh-token cuando se solicita
    un access-token usando un refresh-token
This commit is contained in:
Victor Saisa Lopez
2015-04-20 11:35:49 -04:00
parent 03bc2efa3f
commit caf55a7e07
2 changed files with 13 additions and 4 deletions

View File

@@ -68,7 +68,10 @@ class Server implements iAuthenticate
$this->server->addGrantType(new \ProcessMaker\Services\OAuth2\PmClientCredentials($this->storage));
// Add the "Refresh token" grant type
$this->server->addGrantType(new \OAuth2\GrantType\RefreshToken($this->storage));
$this->server->addGrantType(new \OAuth2\GrantType\RefreshToken(
$this->storage,
array("always_issue_new_refresh_token" => true)
));
// create some users in memory
//$users = array('bshaffer' => array('password' => 'brent123', 'first_name' => 'Brent', 'last_name' => 'Shaffer'));
@@ -261,7 +264,9 @@ class Server implements iAuthenticate
if ($returnResponse) {
return $response;
} else {
die($response->send());
$response->send();
exit(0);
}
}
@@ -279,9 +284,11 @@ class Server implements iAuthenticate
if ($request == null) {
$request = \OAuth2\Request::createFromGlobals();
}
$response = $this->server->handleTokenRequest($request);
$response = $this->server->handleTokenRequest($request); //Set/Get token //PmPdo->setAccessToken()
$token = $response->getParameters();
if (array_key_exists('access_token', $token)
&& array_key_exists('refresh_token', $token)
) {