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

Postgres Database Incompatibility #251

Closed
aasemani opened this issue Dec 16, 2022 · 2 comments
Closed

Postgres Database Incompatibility #251

aasemani opened this issue Dec 16, 2022 · 2 comments

Comments

@aasemani
Copy link

I am trying to use a Postgres instead of the H2 DB for my application. When switching to Postgres DB I get errors relating to column type. I have tried multiple different types such as OID, VARCHAR, BIGINT,... .
Is the application compatible with Postgres? What are the databases I can use other than H2 for the passkey to work?

java.lang.IllegalArgumentException: Parameter value [ByteArray(0b1a119b1c68f9756e3b0046d49bb46c06ec99759153439a3c40a7ee9075dbb1)] did not match expected type [[B (n/a)] at org.hibernate.query.spi.QueryParameterBindingValidator.validate(QueryParameterBindingValidator.java:54) ~[hibernate-core-5.6.12.Final.jar:5.6.12.Final] at org.hibernate.query.spi.QueryParameterBindingValidator.validate(QueryParameterBindingValidator.java:27) ~[hibernate-core-5.6.12.Final.jar:5.6.12.Final] at org.hibernate.query.internal.QueryParameterBindingImpl.validate(QueryParameterBindingImpl.java:90) ~[hibernate-core-5.6.12.Final.jar:5.6.12.Final]

@emlun
Copy link
Member

emlun commented Dec 16, 2022

Hi! The library is completely database-agnostic, so any database should work. In particular, I don't think the library nor its tests or the demo application has ever had a dependency on H2.

It looks like you might be trying to directly persist a RegisteredCredential instance, which isn't working because you have no ORM mapping for how to persist a com.yubico.webauthn.data.ByteArray. You might need to convert the RegisteredCredential to your own ORM type for storage and then re-assemble it in your CredentialRepository method implementations, or alternatively define type mappings so your ORM can persist a RegisteredCredential directly if you prefer that.

See also #173.

@aasemani
Copy link
Author

@emlun thank you for the help. I was able to get it working by converting all the ByteArray variables to string and saving them as varchar in database. Also needed to remove @lob annotation.

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

No branches or pull requests

2 participants