Skip to content

JdbcOAuth2AuthorizationService should not use Blob #387

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

Closed
clgraf opened this issue Aug 4, 2021 · 1 comment
Closed

JdbcOAuth2AuthorizationService should not use Blob #387

clgraf opened this issue Aug 4, 2021 · 1 comment
Assignees
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@clgraf
Copy link

clgraf commented Aug 4, 2021

JdbcOAuth2AuthorizationService persists the tokens as Blobs (authorization_code_value, oidc_id_token_value, refresh_token_value and authorization_code_value).

It works great with H2 but I'm not sure if it works with Postgres (my case) or even another database.
Other point, it's harder to query the database directly, for maintenence or debugging. I'm not sure about performance.

All above fields can be easily represented as Strings, so my sugestion is to change the sql types to Varchar instead of Blob.

BTW, maybe there is a good reason to use Blobs but I can't see.

@clgraf clgraf added the type: bug A general bug label Aug 4, 2021
@jgrandja
Copy link
Collaborator

jgrandja commented Aug 9, 2021

@clgraf We've aligned JdbcOAuth2AuthorizationService with JdbcOAuth2AuthorizedClientService (in spring-security-oauth2-client) as they both use blob for storing token credentials.

If you want to use varchar instead, you may customize the configuration. See this comment for further details.

@jgrandja jgrandja closed this as completed Aug 9, 2021
@jgrandja jgrandja self-assigned this Aug 9, 2021
@jgrandja jgrandja added status: duplicate A duplicate of another issue status: declined A suggestion or change that we don't feel we should currently apply and removed type: bug A general bug status: duplicate A duplicate of another issue labels Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

2 participants