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

Form based authentication cookie will soon be rejected #12441

Closed
rolintoucour opened this issue Oct 1, 2020 · 1 comment · Fixed by #12450
Closed

Form based authentication cookie will soon be rejected #12441

rolintoucour opened this issue Oct 1, 2020 · 1 comment · Fixed by #12450
Labels
area/security kind/bug Something isn't working
Milestone

Comments

@rolintoucour
Copy link

Describe the bug
I register it as a bug because soon it won't work anymore.

Using the Form Based Authentication, a cookie is created, with default name "quarkus-credential". Doing so, Firefox warns:
Cookie “quarkus-credential” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

I followed the tutorial: http://fxapps.blogspot.com/2019/12/quarkus-application-with-form.html

Expected behavior
We should be able to customize the cookie attributes, at least "SameSite" and "Secure".

Actual behavior
We can only customize the cookie name using "quarkus.http.auth.form.cookie-name".

Configuration

quarkus.http.auth.form.enabled=true
quarkus.security.jdbc.enabled=true
quarkus.security.jdbc.principal-query.datasource=auth
quarkus.security.jdbc.principal-query.sql=SELECT password FROM users u WHERE u.login=?
quarkus.security.jdbc.principal-query.bcrypt-password-mapper.enabled=true
quarkus.security.jdbc.principal-query.bcrypt-password-mapper.password-index=1
quarkus.security.jdbc.principal-query.bcrypt-password-mapper.iteration-count-index=-1
quarkus.security.jdbc.principal-query.bcrypt-password-mapper.salt-index=-1
quarkus.security.jdbc.principal-query.roles.sql=select r.name as role_name from roles r, (select m.role_id from assigned_role m join user u on m.user_id = u.id and u.login = ?) a where r.id >= a.role_id
quarkus.security.jdbc.principal-query.roles.datasource=auth
quarkus.security.jdbc.principal-query.roles.attribute-mappings.0.index=1
quarkus.security.jdbc.principal-query.roles.attribute-mappings.0.to=groups
quarkus.http.auth.permission.permit1.paths=/secured/*
quarkus.http.auth.permission.permit1.policy=authenticated

Environment (please complete the following information):

  • Output of uname -a or ver: Linux netwave-lolo 5.4.0-48-generic Adjust log colors, and do not log in color if the console is not in color #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linu
  • Output of java -version: openjdk version "1.8.0_252"
    OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)
    OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.252-b09, mixed mode)
  • GraalVM version (if different from Java): -
  • Quarkus version or git rev: 1.8.1
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
@sberyozkin
Copy link
Member

@rolintoucour Hopefully #12450 will fix it

@gsmet gsmet added this to the 1.9.0 - master milestone Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants