Skip to content

fix(oauth): increase access_token and refresh_token length to 4096 #22

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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