-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I used the script at /data/oauth2.sql to create the database model. Here I find the following table definition:
CREATE TABLE `oauth_access_tokens` (
...
`user_id` int(10) DEFAULT NULL,
`client_id` int(10) NOT NULL,
...
);
The column types are therefore integers, which also makes sense if you want to refer to the IDs of the tables oauth_clients and oauth_users.
But then the following array is assembled in Mezzio\Authentication\OAuth2\Repository\Pdo\AccessTokenRepository:
$params = [
':id' => $accessTokenEntity->getIdentifier(),
':user_id' => $accessTokenEntity->getUserIdentifier(),
':client_id' => $accessTokenEntity->getClient()->getIdentifier(),
':scopes' => $this->scopesToString($accessTokenEntity->getScopes()),
':revoked' => 0,
':expires_at' => date(
'Y-m-d H:i:s',
$accessTokenEntity->getExpiryDateTime()->getTimestamp()
),
];
And here user_id and client_id are returned as a string, which is why the database INSERT subsequently fails and the UniqueTokenIdentifierConstraintViolationException is thrown.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels