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

filter is applied to paths that should be allowed in http security configuration with new SS 6.4.3 #16703

Open
gigi888 opened this issue Mar 6, 2025 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug

Comments

@gigi888
Copy link

gigi888 commented Mar 6, 2025

Describe the bug
this is how I configure http security using the SS 6.4.3

  @Bean
  open fun securityFilterChain(http: HttpSecurity, authManager: AuthenticationManager): SecurityFilterChain {
    http {
      authorizeHttpRequests {
        authorize(HttpMethod.OPTIONS, "/**", permitAll)
         authorize(HttpMethod.GET, "/swagger-ui.html", permitAll)       
        authorize(anyRequest, authenticated)
      }
      csrf { disable() }
      sessionManagement {
        sessionCreationPolicy = SessionCreationPolicy.STATELESS
      }
      addFilterBefore<AuthorizationFilter>(MyFilter(processor, authManager))
    }
    return http.build()
  }

even though '/swagger-ui.html' is configured to skip authentication, MyFilter is found applied to /swagger-ui.html. It was not the case with SS 5.4

To Reproduce
Steps to reproduce the behavior.

Expected behavior
filter added later should NOT be applied to paths configured with permitAll

Sample

A link to a GitHub repository with a minimal, reproducible sample.

Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.

@gigi888 gigi888 added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Mar 6, 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