Skip to content

Allow all HttpSecurity DSL methods to apply Customizer.withDefaults() by default #17497

Open
@DeepDhamala

Description

@DeepDhamala

Expected Behavior

Developers should be able to enable default security configurations using a fluent, no-argument DSL in the SecurityFilterChain lambda DSL.

http
  .csrf()
  .formLogin()
  .httpBasic()
  .logout();

Current Behavior


http
  .csrf(Customizer.withDefaults())
  .formLogin(Customizer.withDefaults())
  .httpBasic(Customizer.withDefaults())
  .logout(Customizer.withDefaults());

I see that there are methods already reserved with no-argument which are needed for configuration without using lambdas . That said, there’s room to make it work without withDefaults(). As a big project there are
definitely various aspect to things and I’d love to hear more about this and the possibility of making this change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions