Added 503 as a token revoke

Change-Id: If962bd04de2996046b5c1d8d8f5e6e7a8b90764a
This commit is contained in:
Sebastian Marcet 2017-05-08 14:41:02 -03:00
parent 99c09af7e4
commit 165cc128ff

View File

@ -222,6 +222,11 @@ final class AccessTokenService implements IAccessTokenService
$this->cache_service->setSingleValue(md5($token_value).'.revoked', md5($token_value));
throw new InvalidGrantTypeException($body['error']);
}
if($code == 503 ){
// service went online temporally ... revoke token
$this->cache_service->setSingleValue(md5($token_value).'.revoked', md5($token_value));
throw new InvalidGrantTypeException(OAuth2Protocol::OAuth2Protocol_Error_InvalidToken);
}
throw new OAuth2InvalidIntrospectionResponse(sprintf('http code %s - body %s', $ex->getCode(), $response->getBody()));
}
}