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

Saml2LoginConfigurer relyingPartyRegistrationRepository method does not return correct type #10245

Closed
dvanbler opened this issue Sep 9, 2021 · 3 comments
Assignees
Labels
in: saml2 An issue in SAML2 modules status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@dvanbler
Copy link
Contributor

dvanbler commented Sep 9, 2021

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.

@dvanbler dvanbler added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Sep 9, 2021
@marcusdacoregio marcusdacoregio self-assigned this Sep 13, 2021
@marcusdacoregio marcusdacoregio added in: saml2 An issue in SAML2 modules and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 13, 2021
@marcusdacoregio
Copy link
Contributor

Hi @dvanbler, thanks for bringing this to our attention.

Exactly, this should be changed to public Saml2LoginConfigurer<B> relyingPartyRegistrationRepository(RelyingPartyRegistrationRepository repo).

Are you able to submit a PR that fixes it?

@dvanbler
Copy link
Contributor Author

Pull request for this issue: gh-10256

@marcusdacoregio marcusdacoregio added this to the 5.5.3 milestone Sep 13, 2021
@marcusdacoregio
Copy link
Contributor

Fixed via 58d5088

@marcusdacoregio marcusdacoregio modified the milestones: 5.5.3, 5.6.0-M3 Sep 13, 2021
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.5.x labels Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: saml2 An issue in SAML2 modules status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants