You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and the new access token identifier is generated with
protectedfunctiongenerateUniqueIdentifier($length = 40)
{
try {
returnbin2hex(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
}
And that's where a problem appears: even though it is 40 bytes, one still cannot interchange the "unique" term with the "random" term.
Suggestion: the method that issues an access token might have done that in a loop with N maximum iterations (to prevent an infinite loop in case of an implementation or other issues) and catch for the specifically designed exception thrown from $this->accessTokenRepository->persistNewAccessToken($accessToken);.
An exception can be of a predefined type, eg: League\OAuth2\Server\Exception\UniqueAccessTokenIdentifierConstraintViolationException.
The text was updated successfully, but these errors were encountered:
At the moment the new access token is issued with the following code
and the new access token identifier is generated with
And that's where a problem appears: even though it is 40 bytes, one still cannot interchange the "unique" term with the "random" term.
Suggestion: the method that issues an access token might have done that in a loop with N maximum iterations (to prevent an infinite loop in case of an implementation or other issues) and catch for the specifically designed exception thrown from
$this->accessTokenRepository->persistNewAccessToken($accessToken);
.An exception can be of a predefined type, eg:
League\OAuth2\Server\Exception\UniqueAccessTokenIdentifierConstraintViolationException
.The text was updated successfully, but these errors were encountered: