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
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
Run the Admin migrations, and check oauth_access_tokens.user_id: it is VARCHAR(25).
With an API on the same database, request a token for a user whose identity has example johndoe@somerandomemail.com (27).
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