Skip to content

ServerHttpSecurity can't set multiple authentication managers #5660

Closed

Description

@kyle-c9000

Summary

The documentation seems to support allowing different authentication managers for different authentication specs (HttpBasicSpec and FormLoginSpec). However, those seem to always be overwritten when the .build() method is called:

HttpBasicSpec overwritten
FormLoginSpec overwritten

Actual Behavior

HttpBasicSpec and FormLoginSpec can not use different AuthenticationManagers

Expected Behavior

HttpBasicSpec and FormLoginSpec should be able to use different AuthenticationManagers

Configuration

    public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
        http
            // ...
            .httpBasic()
                    .authenticationManager(authenticationManager1)
            .and()
            .formLogin()
                    .authenticationManager(authenticationManager2);
        return http.build();
    }

Version

spring-security 5.0.6.RELEASE

The problematic code referenced in the summary appears to still exist in the master branch.

Sample

N/A

Activity

  1. changed the title [-]ServerHttpSecurity multiple authenticationManager[/-] [+]ServerHttpSecurity can't set multiple authentication managers[/+] on Aug 13, 2018
  2. modified the milestones: 5.1.0.RC1, 5.1.0.RC2 on Aug 13, 2018
  3. self-assigned this
    on Aug 13, 2018
  4. added 2 commits that reference this issue on Jun 28, 2019
    7782e29
    9d543ce
  5. added a commit that references this issue on Aug 26, 2019
    9d088cd
  6. srinivasmkoppal commented on Sep 7, 2023

    @srinivasmkoppal

    what is authenticationManager1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: configAn issue in spring-security-configstatus: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions