-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Quarkus fails to start with bcrypt password mapper #38634
Comments
I can see the config properties that might fix it here: https://quarkus.io/guides/security-jdbc But there's virtually no documentation on what value these properties should have. |
Also note that I used |
cc @sberyozkin |
@wowselim The documentation for the Bcrypt related properties says that the indexes of the columns use 1 based numbering, but you only have specified the password index, but no salt and iteration count indexes, so this is a configuration issue. I haven't used this extension but I believe they should point to the table columns containing the bcrypt salt, iteration count etc.
I believe you should use |
@sberyozkin what can I do if I want to use bcrypt like it's described here:
Setting all of those other configs to I think having them as separate columns is pretty outdated and most libraries (vert.x, spring boot) do it in this format (as does quarkus as seen above). |
https://quarkus.io/guides/security-jpa#password-storage-and-hashing is a different extension,
This issue is about Quarkus failing to start using I think we can close this issue since your requirement is possibly about using |
@sberyozkin actually I would like to use quarkus-security-jdbc specifically because I use jooq for the db layer and I don’t want a dependency on hibernate. I just wanted to highlight the inconsistency regarding jpa and jdbc when it comes to auth. The jpa approach seems more modern in this aspect. I think it would be more appropriate to create a ticket to improve the jdbc docs to show how to handle bcrypt since it’s not clear when the docs only use clear text. |
i think jpa is much better documented (see the link i posted before). The jdbc docs leave out some important details since they only focus on clear text auth. |
@wowselim Sure, I suppose we can resolve this issue by updating the JDBC docs, like I said, I haven't worked with this extension, but what I understand is that you can use BCryptUtil method to create a hash with a known salt and count, and then, in the tutorial, you can update that Create Table instruction to include the hash, salt and count and refer to their column indexes in the configuration. I agree it is a fairly low level approach, but it is done by design in Would you like to test it and it works I can update the docs ? |
@sberyozkin Sure, I would like to improve the docs and provide a bcrypt example. I've found this on the web: https://issues.redhat.com/browse/ELY-1497 So it seems like support for this format should already be in wildfly jdbc security realm ( |
Hey, I've asked around on the elytron zulip server and it looks like there's no interest in this feature or a contribution. This issue can be closed since it's essentially a duplicate of #5667. |
@wowselim Hi, can you please try what is suggested in #38634 (comment) here ? |
@sberyozkin it will not work because BCryptUtil uses the modular crypt format which is not supported by the jdbc security extension. See the javadoc for the hashing function: |
@wowselim If you'd like you can consider opening a PR where BcryptUtil class will have another method for producing a format understood by the JDBC extension ? |
@sberyozkin I don't like the idea of having the three (password, salt, iteration count) split to be honest. It's quite unconventional and not used anywhere else as far as I know. |
Sounds good @wowselim, thanks, do you have an account on X ? If yes, please consider promoting your post there as well. |
@sberyozkin |
Describe the bug
When using
elytron-security-jdbc
and configuring the bcrypt password mapper, the quarkus application fails to start with the following error.Expected behavior
Application starts successfully.
Actual behavior
We get the following stack trace:
How to Reproduce?
Add these to your
application.properties
and run the application:Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.7.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
Here's a project that simply adds the elytron jdbc dependency and uses the aforementioned config
jdbc-auth-reproducer.zip
The text was updated successfully, but these errors were encountered: