Merge branch 'V5-WIP' into move_identifier_generation

This commit is contained in:
Julián Gutiérrez
2016-02-13 14:11:38 +01:00
52 changed files with 443 additions and 3561 deletions

View File

@@ -34,13 +34,6 @@ abstract class AbstractGrant implements GrantTypeInterface
const SCOPE_DELIMITER_STRING = ' ';
/**
* Grant responds with
*
* @var string
*/
protected $respondsWith = 'token';
/**
* @var ServerRequestInterface
*/
@@ -132,14 +125,6 @@ abstract class AbstractGrant implements GrantTypeInterface
$this->refreshTokenTTL = $refreshTokenTTL;
}
/**
* {@inheritdoc}
*/
public function respondsWith()
{
return $this->respondsWith;
}
/**
* Validate the client
*
@@ -382,13 +367,16 @@ abstract class AbstractGrant implements GrantTypeInterface
{
try {
return bin2hex(random_bytes($length));
// @codeCoverageIgnoreStart
} catch (\TypeError $e) {
throw OAuthServerException::serverError('An unexpected error has occurred');
} catch (\Error $e) {
throw OAuthServerException::serverError('An unexpected error has occurred');
} catch (\Exception $e) {
// If you get this message, the CSPRNG failed hard.
throw OAuthServerException::serverError('Could not generate a random string');
}
// @codeCoverageIgnoreEnd
}
/**