Skip to content

Assert that array-key exists on decoded refresh token. #1501

@mrtus

Description

@mrtus

When users are using the RefreshTokenGrant they seem to be using the AuthCodeGrant its token value as refresh_token value.
Which is of course incorrect, but the framework does not handle this scenario correctly.

Since both tokens use the same encryption key, the decryption simply happens without any error.
However, when the token is json decoded the array is missing an array-key refresh_token_id.

This causes if ($this->refreshTokenRepository->isRefreshTokenRevoked($refreshTokenData['refresh_token_id']) === true) { to throw a TypeError because a null argument is given to a string $tokenId method signature.

Suggestion
Validate that all array-keys exist before using them, otherwise throw a throw OAuthServerException::invalidRequest('refresh_token') exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions