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

Using XML configuration, separate HTTP elements share authentication #16658

Open
cartbar opened this issue Feb 26, 2025 · 0 comments
Open

Using XML configuration, separate HTTP elements share authentication #16658

cartbar opened this issue Feb 26, 2025 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug

Comments

@cartbar
Copy link

cartbar commented Feb 26, 2025

I created an XML file to configure the Spring Security in my application:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
             xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans
        https://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/security
        https://www.springframework.org/schema/security/spring-security.xsd">

    <http pattern="/B.html">
        <headers >
            <frame-options disabled="true"></frame-options>
        </headers>
        <http-basic />
        <intercept-url pattern="*" access="permitAll" />
    </http>


    <http pattern="/**">
        <intercept-url pattern="/**" access="isAuthenticated()" />
        <http-basic />
    </http>
.
.
.
</beans:beans>

The expectation is that requests for "/B.html" will have the XFRAME header disabled AND not require authentication, and all other request would have the default headers and require authentication.

In fact, requests for "/B.html" do have the XFRAME header disables (as expected) but require authentication.

It appears that the filter that does the authenication applies the rules for both sections, so that the first rule permits access and the second rule requires authentication, rather than only applying the rules from the relevant HTTP element

@cartbar cartbar added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Feb 26, 2025
@cartbar cartbar changed the title Using XML configuration, separate HTTP element share authentication Using XML configuration, separate HTTP elements share authentication Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant