Skip to content

authorizeHttpRequests ignores AuthenticationProvider #12602

@zotornit

Description

@zotornit

version
org.springframework.boot:spring-boot-starter-security:3.0.3-SNAPSHOT which comes with spring-security 6.0.1

Describe the bug

when using authorizeHttpRequests instead of the deprecated authorizeRequests the AuthenticationProvider is not used / basically ignored.

To Reproduce
Download linked repository and switch the commented code with the uncommented in SecurityConfig then call http://localhost:8080/secure

                // using this works 200
            .authorizeRequests {
                it.requestMatchers("/unsecure").permitAll()
                it.anyRequest().authenticated()
            }

                // this block causes 403
//            .authorizeHttpRequests {
//                it.requestMatchers("/unsecure").permitAll()
//                it.anyRequest().authenticated()
//            }

Expected behavior
authorizeHttpRequests and authorizeRequests should behave the same.

Sample

A link to a GitHub repository

Metadata

Metadata

Labels

status: invalidAn issue that we don't feel is validtype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions