Skip to content

Saml2LoginConfigurer relyingPartyRegistrationRepository method does not return correct type #10245

@dvanbler

Description

@dvanbler

Describe the bug
A call to saml2Login().relyingPartyRegistrationRepository(...).and() does not return a type that can be further configured with spring security.

To Reproduce

public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    protected void configure(HttpSecurity http) throws Exception {
        http
            .saml2Login()
            .relyingPartyRegistrationRepository(relyingPartyRegistrationRepository())
            .and() // <-- A SecurityBuilder object is returned here instead of an HttpSecurity object
            .logout(); // <-- fails due to incorrect object returned by and()
    }
}

Note that relyingPartyRegistrationRepository appears to be the only saml configuration method that causes this problem.

I assume that this:

public Saml2LoginConfigurer relyingPartyRegistrationRepository(RelyingPartyRegistrationRepository repo) {

needs to be changed to this:

public Saml2LoginConfigurer<B> relyingPartyRegistrationRepository(RelyingPartyRegistrationRepository repo) {

Expected behavior
Ability to configure other non-saml http security properties after configuring saml2 relying party registry.

Metadata

Metadata

Labels

in: saml2An issue in SAML2 modulesstatus: 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