vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
622 stars 166 forks source link

Wrong redirect after authentication when PUSH transport is WEBSOCKET #20575

Open mcollovati opened 5 days ago

mcollovati commented 5 days ago

Description of the bug

When the Vaadin application is configured with VaadinWebSecurity, OAUTH2 and WEBSOCKET PUSH transport, the URL stored for redirection after successful login is incorrect; it points to the PUSH mapping instead of the requested page. For example, when navigating to a protected route /, the browser is redirected to the login page, but the stored URL is http://localhost:8080/VAADIN/push instead of http://localhost:8080/. After entering correct credentials, the browser is redirected to /VAADIN/push, resulting in a 404 error page.

Expected behavior

After successful login, the original request page should be shown. In the example above, the browser should be redirected to http://localhost:8080/.

Minimal reproducible example

Versions

mcollovati commented 4 days ago

It can also be replicate without OAUTH2, by creating a public view with a link to a protected route. Start from the public view, click on the link, enter credential after being redirected to log in view, check that /VAADIN/push URL is requested.