Skip to content

6.5.0-M3 - passkeys jdbc user-credentials-schema.sql blob columns not compatible with postgresql #16832

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
zyro23 opened this issue Mar 27, 2025 · 2 comments · Fixed by #16839
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug

Comments

@zyro23
Copy link

zyro23 commented Mar 27, 2025

Describe the bug
org/springframework/security/user-credentials-schema.sql contains blob columns.

that is not supported on postgresql:

org.postgresql.util.PSQLException: ERROR: type "blob" does not exist

To Reproduce
try to run the ddl-/schema-sql against a postgresql database manually.

Expected behavior
a postgresql-compatible schema should be provided.

Sample

[2025-03-27 10:21:47] Connected
demo.public> create table user_credentials
                (
                    credential_id                varchar(1000) not null,
                    user_entity_user_id          varchar(1000) not null,
                    public_key                   blob          not null,
                    signature_count              bigint,
                    uv_initialized               boolean,
                    backup_eligible              boolean       not null,
                    authenticator_transports     varchar(1000),
                    public_key_credential_type   varchar(100),
                    backup_state                 boolean       not null,
                    attestation_object           blob,
                    attestation_client_data_json blob,
                    created                      timestamp,
                    last_used                    timestamp,
                    label                        varchar(1000) not null,
                    primary key (credential_id)
                )
[2025-03-27 10:21:47] [42704] ERROR: type "blob" does not exist
[2025-03-27 10:21:47] Position: 180

Misc
changing the blob columns to bytea seems to work for postgresql.

@zyro23 zyro23 added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Mar 27, 2025
@ngocnhan-tran1996
Copy link
Contributor

Spring Security use H2 for default dabase. If you have another database, you should have your own script.

Reference
https://docs.spring.io/spring-security/reference/servlet/authentication/passwords/jdbc.html

franticticktick added a commit to franticticktick/spring-security that referenced this issue Mar 28, 2025
@franticticktick
Copy link
Contributor

Hey @zyro23, good catch :) This tikect will be solved via #16839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants