Skip to content

user_id too short in OAuthAccessToken.php #585

Closed

Description

@Howriq

Bug Report

Q A
Version(s) 7.2.0

Summary

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). Any identity longer than 25 characters (for example an email address) cannot get an access token.

With strict SQL mode (the MariaDB/MySQL default) the insert fails:

An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for 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. Create a user whose identity has more than 25 characters, for example johndoe@somerandomemail.com (27).
  2. Request a token for that user (POST /security/generate-token with the password grant)
  3. The request fails with the error above.

Expected behavior

The token is issued. oauth_access_tokens.user_id should be as long as identity (VARCHAR(191)),

Activity

  1. self-assigned this
    on Nov 18, 2026
  2. added theissue type on 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

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions