Skip to content

user_id too short in OAuthAccessToken.php #479

Closed

Description

@Howriq

Bug Report

Q A
Version(s) 7.2.0

Summary

Same issue as dotkernel/api#585, in the Core that Admin ships.

OAuthAccessToken::$userId is mapped as VARCHAR(25):

#[ORM\Column(name: 'user_id', type: 'string', length: 25)]

The value stored there is the user identifier, which User::getIdentifier() and Admin::getIdentifier() return as identity. identity is VARCHAR(191). So any identity longer than 25 characters (for example an email address) cannot get an access token.

Admin does not issue OAuth tokens itself, but its mapping and migrations create the n an API uses that database, the insert fails in strict SQL mode (the MariaDB/MySQLdefault):

An exception occurred while executing a query: SQLSTATE[22001]: String data, right tfor column 'user_id' at row 1

Without strict mode the value is truncated, so the token no longer matches its user.

How to reproduce

  1. Run the Admin migrations, and check oauth_access_tokens.user_id: it is VARCHAR(25).
  2. With an API on the same database, request a token for a user whose identity has example johndoe@somerandomemail.com (27).
  3. The request fails with the error above.

Expected behavior

OAuthAccessToken::$userId and oauth_access_tokens.user_id are as long as identity (VARCHAR(191)), with a migration that widens the column, in both Admin and API.

Activity

  1. self-assigned this
    on Nov 18, 2026
  2. linked a pull request that will close this issueuser_id too short in OAuthAccessToken.php #480on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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