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

RequestedUrlRedirectInvalidSessionStrategy doesn't take servlet context path into account #12795

Closed
mches opened this issue Feb 27, 2023 · 0 comments · Fixed by #12817
Closed
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Milestone

Comments

@mches
Copy link
Contributor

mches commented Feb 27, 2023

Describe the bug
When using RequestedUrlRedirectInvalidSessionStrategy as the invalid session strategy within the session management of the security filter chain, with a non-empty servlet context path configured, the context path is duplicated in the redirect URLs. For example, if the context path is "/app" and the requested URI is "/app/requested", then the redirect URL becomes "/app/app/requested".

To Reproduce
Configure a non-empty context path such as "/app". Set an instance of RequestedUrlRedirectInvalidSessionStrategy as the invalid session strategy in the security filter chain. Access the app at "http://localhost:8080/app/requested" with an invalid session ID. Get redirected to "/app/app/requested".

Expected behavior
The redirect should not duplicate the context path segments. It should be the same as the request URI, "/app/requested".

Sample

5.7.x...mches:spring-security:gh-12795

@mches mches added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Feb 27, 2023
jzheaux pushed a commit that referenced this issue Oct 16, 2023
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Oct 16, 2023
@jzheaux jzheaux self-assigned this Oct 16, 2023
@jzheaux jzheaux added this to the 6.2.0-RC2 milestone Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants