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

Add Saml2AuthenticationRequestResolver #9277

Conversation

jzheaux
Copy link
Contributor

@jzheaux jzheaux commented Dec 11, 2020

This PR simplifies the customization of AuthnRequest by introducing a component that can provide both the HttpServletRequest and RelyingPartyRegistration to the application:

@Bean 
public Saml2AuthenticationRequestResolver authenticationRequestResolver(RelyingPartyRegistrationResolver registrations) {
    OpenSaml4AuthenticationRequestResolver authenticationRequestResolver = 
            new OpenSaml4AuthenticationRequestResolver(registrations);
    authenticationRequestResolver.setAuthnRequestCustomizer((context) -> {
        AuthnRequest authnRequest = context.getAuthnRequest();
        HttpServletRequest request = context.getRequest();
        authnRequest.setForceAuthn(request.getParameter("force"));
    });
    return authenticationRequestResolver;
}

This component supercedes Saml2AuthenticationRequestFactory, Saml2AuthenticationRequestContextResolver, and Saml2AuthenticationRequestContext.

@jzheaux jzheaux force-pushed the saml2-authentication-request-resolver branch from 63b94a4 to 04d1bc8 Compare December 11, 2020 01:30
@jzheaux jzheaux requested a review from rwinch December 15, 2020 15:28
@jzheaux jzheaux added in: saml2 An issue in SAML2 modules type: enhancement A general enhancement labels Dec 15, 2020
@jzheaux jzheaux self-assigned this Jan 5, 2021
@jzheaux jzheaux force-pushed the saml2-authentication-request-resolver branch from 04d1bc8 to 05438be Compare March 4, 2021 23:57
@jzheaux jzheaux force-pushed the saml2-authentication-request-resolver branch from 05438be to 597cdf8 Compare March 19, 2021 02:57
@jzheaux jzheaux force-pushed the saml2-authentication-request-resolver branch 3 times, most recently from 00bec30 to 7ccf966 Compare October 8, 2021 20:51
@jzheaux jzheaux force-pushed the saml2-authentication-request-resolver branch 2 times, most recently from e738315 to a77ecb5 Compare October 14, 2021 17:57
@jzheaux jzheaux added this to the 5.7.0-M1 milestone Nov 19, 2021
@jzheaux jzheaux force-pushed the saml2-authentication-request-resolver branch from a77ecb5 to ccbc119 Compare November 19, 2021 20:45
@jzheaux jzheaux force-pushed the saml2-authentication-request-resolver branch from ccbc119 to 12f8ea6 Compare November 19, 2021 20:56
@jzheaux
Copy link
Contributor Author

jzheaux commented Nov 19, 2021

@Primedo, @fpagliar - would you be able to give this a review to see if it simplifies your SAML configuration?

@jzheaux
Copy link
Contributor Author

jzheaux commented Jan 24, 2022

Merged with d538423

@jzheaux jzheaux closed this Jan 24, 2022
@jzheaux jzheaux deleted the saml2-authentication-request-resolver branch January 24, 2022 23:26
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 type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants