You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that the problem comes from vaadin/flow#14853: if I do the same change on 23.3 and try to use it with Hilla 1.3, integration tests pass, but applications can no longer log in. The code removed in that PR cannot be restored because it no longer works (requestResponseHolder.getResponse() is null), but must be replaced with a different implementation. The fact of calling saveContext while loading the context is no longer possible, but Hilla 1.3 was counting on that to pass the context between calls.
I was wrong. The issue is not there. It's this response header: XSRF-TOKEN=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/ which resets that cookie and causes a mismatch when verifying the POST request for the authenticated user, which then returns a 401 and the client application resorts to an infinite login. Now I must search where that empty cookie is set.
That header is set in the authentication request, and only in that case. Otherwise, the XSRF-TOKEN is expected to have a value. Hilla 1.3 correctly resets that cookie only in the authentication response.
But with Hilla 2, other requests are seen as authentication ones, even some completely unrelated like http://localhost:8080/VAADIN/@vite/client or http://localhost:8080/VAADIN/generated/vite-devmode.ts, but not others like http://localhost:8080/VAADIN/generated/vaadin-featureflags.ts. I have the feeling that those empty cookies are sent for some time after the first auth response.
There are also some JSESSIONID cookies sent, all different.
Activity
simasch commentedon Dec 1, 2022
The issue seems to be vaadin/flow#14923
Artur- commentedon Dec 1, 2022
Looks like some other problem as
CsrfTokenRequestAttributeHandleris used and notXorCsrfTokenRequestAttributeHandlersimasch commentedon Dec 1, 2022
Alright. Thank you
simasch commentedon Dec 21, 2022
Any news on that? I'm working on a Hilla talk and it would be great to show Hilla 2 with Spring Boot 3
cromoteca commentedon Feb 1, 2023
I think that the problem comes from vaadin/flow#14853: if I do the same change on 23.3 and try to use it with Hilla 1.3, integration tests pass, but applications can no longer log in. The code removed in that PR cannot be restored because it no longer works (
requestResponseHolder.getResponse()isnull), but must be replaced with a different implementation. The fact of callingsaveContextwhile loading the context is no longer possible, but Hilla 1.3 was counting on that to pass the context between calls.Artur- commentedon Feb 1, 2023
Where in the code can you see the problem when debugging? Or in other words, what is not available at which point?
cromoteca commentedon Feb 1, 2023
I was wrong. The issue is not there. It's this response header:
XSRF-TOKEN=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/which resets that cookie and causes a mismatch when verifying the POST request for the authenticated user, which then returns a 401 and the client application resorts to an infinite login. Now I must search where that empty cookie is set.cromoteca commentedon Feb 1, 2023
That header is set in the authentication request, and only in that case. Otherwise, the
XSRF-TOKENis expected to have a value. Hilla 1.3 correctly resets that cookie only in the authentication response.But with Hilla 2, other requests are seen as authentication ones, even some completely unrelated like
http://localhost:8080/VAADIN/@vite/clientorhttp://localhost:8080/VAADIN/generated/vite-devmode.ts, but not others likehttp://localhost:8080/VAADIN/generated/vaadin-featureflags.ts. I have the feeling that those empty cookies are sent for some time after the first auth response.There are also some
JSESSIONIDcookies sent, all different.I still haven't been able to understand what causes this behavior. Anyway, the wrong path passes by this: https://github.com/spring-projects/spring-security/blob/19c55372a3f2f97d1f0ee235f90b38187a8b3a69/web/src/main/java/org/springframework/security/web/session/SessionManagementFilter.java#L97-L102
Only the first
http://localhost:8081/loginrequest should show that behavior.fix: Use correct SecurityContextRepository for stateless authenticati…
vaadin-bot commentedon Feb 3, 2023
This ticket/PR has been released with Vaadin 24.0.0.alpha10 and is also targeting the upcoming stable 24.0.0 version.