-
Notifications
You must be signed in to change notification settings - Fork 176
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
fix: update JWT cookie at every request #18994
Conversation
Fixes stateless authentication, by updating the JWT cookies at every request, preventing the browser to remove the cookie after initial max-age time is expired. Fixes #18880
Tested the change also with Hilla integration test |
Test Results1 091 files + 1 1 091 suites +1 1h 24m 50s ⏱️ + 2m 47s Results for commit 52de1f8. ± Comparison against base commit 94b2560. This pull request removes 1 and adds 7 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Removed workaround for spring-projects/spring-security#12579 since it has been fixed. |
@@ -84,18 +97,32 @@ public final class VaadinStatelessSecurityConfigurer<H extends HttpSecurityBuild | |||
|
|||
private SecretKeyConfigurer secretKeyConfigurer; | |||
|
|||
public void setSharedObjects(HttpSecurity http) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is public in a public class. Maybe it's better to deprecate it, rather than remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense. I'll change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -84,18 +97,32 @@ public final class VaadinStatelessSecurityConfigurer<H extends HttpSecurityBuild | |||
|
|||
private SecretKeyConfigurer secretKeyConfigurer; | |||
|
|||
public void setSharedObjects(HttpSecurity http) { | |||
public static void apply(HttpSecurity http, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs javadocs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
Tested the |
|
* fix: update JWT cookie at every request Fixes stateless authentication, by updating the JWT cookies at every request, preventing the browser to remove the cookie after initial max-age time is expired. Fixes #18880 * apply review suggestions --------- Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
* fix: update JWT cookie at every request Fixes stateless authentication, by updating the JWT cookies at every request, preventing the browser to remove the cookie after initial max-age time is expired. Fixes #18880 * apply review suggestions --------- Co-authored-by: Marco Collovati <marco@vaadin.com> Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
Description
Fixes stateless authentication, by updating the JWT cookies at every request, preventing the browser to remove the cookie after initial max-age time is expired.
Fixes #18895
Type of change
Checklist
Additional for
Feature
type of change