Skip to content

Conversation

Sohail342
Copy link

When using OAuth2 providers such as Authentik with RS256-signed access tokens, the access_token (and sometimes refresh_token) exceeds 1024 characters. This results in a StringDataRightTruncation error in PostgreSQL:

psycopg.errors.StringDataRightTruncation: value too long for type character varying(1024)

Changes

  • Increased access_token and refresh_token field lengths from 1024 to 4096.
  • Verified behavior against PostgreSQL using long RS256 tokens.
  • All tests pass with 100% coverage using hatch run test.

Configuration

  • Python: 3.13
  • FastAPI: 0.115.12
  • fastapi-users-db-sqlalchemy: latest main

This should allow broader compatibility with modern OAuth2 providers.

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

Successfully merging this pull request may close these issues.

1 participant