Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 1406: Data too long for column 'subject' at row 1 #829

Closed
JesseFinch opened this issue Apr 27, 2018 · 8 comments
Closed

Error 1406: Data too long for column 'subject' at row 1 #829

JesseFinch opened this issue Apr 27, 2018 · 8 comments

Comments

@JesseFinch
Copy link

JesseFinch commented Apr 27, 2018

looks like new oauth2 have some troubles with subject field.
for example

An error occurred: Error 1406: Data too long for column 'subject' at row 1

for following oauth2 tables hydra_oauth2_access/hydra_oauth2_code/hydra_oauth2_oidc/hydra_oauth2_refresh/ of subject field.

At the same time, the hydra_consent_request table has a dimensionless field.

@aeneasr
Copy link
Member

aeneasr commented Apr 27, 2018

How long is your subject id?

@JesseFinch
Copy link
Author

JesseFinch commented Apr 27, 2018

427 characters
this is jwt payload

@aeneasr
Copy link
Member

aeneasr commented Apr 27, 2018

Well, that's too long unfortunately, max is 255 characters. Keep in mind that this column will be indexed in the future, so

  1. longer keys are not possible
  2. the longer the key the lower the index performance and the larger the index

@JesseFinch
Copy link
Author

so my question is why hydra_consent_request table has a dimensionless subject field?

@aeneasr
Copy link
Member

aeneasr commented Apr 27, 2018

Yeah, that will be fixed with 1.0.0 as we need that field indexed in order to remove all access tokens of a user, for example.

@JesseFinch
Copy link
Author

oh, it.s ok. but where should i store my JWT? 👑

@aeneasr
Copy link
Member

aeneasr commented Apr 27, 2018

Don't store a JWT as the subject field. The subject field should be a user id in clear text (or hashed to anonymize). If you need extra data use the extra fields in the consent request.

Closing because question answered.

@aeneasr aeneasr closed this as completed Apr 27, 2018
@JesseFinch
Copy link
Author

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants