Skip to content

OpenSAML should get initialized as part of container lifecycle #8772

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

Closed
jzheaux opened this issue Jun 29, 2020 · 0 comments
Closed

OpenSAML should get initialized as part of container lifecycle #8772

jzheaux opened this issue Jun 29, 2020 · 0 comments
Assignees
Labels
in: saml2 An issue in SAML2 modules type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Jun 29, 2020

OpenSAML gets initialized by Spring Security lazily via a package-private class OpenSamlImplementation. This setup makes it tricky for an application to override the defaults that Spring Security specifies.

For example, to use a different ParserPool configuration, one needs to ensure that they call XMLObjectProviderRegistrySupport.setParserPool only after OpenSamlAuthenticationProvider or OpenSamlAuthenticationRequestFactory is classloaded since those are the two classes that use an instance of OpenSamlImplementation.

It may be cleaner to initialize OpenSAML as part of the container lifecycle, for example as a BeanFactoryPostProcessor. In this way, an application can register their own BeanFactoryPostProcessor to override the behavior.

At that point, the code can be removed in OpenSamlImplementation that initializes OpenSAML.

@jzheaux jzheaux added type: enhancement A general enhancement in: saml2 An issue in SAML2 modules labels Jun 29, 2020
@jzheaux jzheaux added this to the 5.4.0-RC1 milestone Jun 29, 2020
@jzheaux jzheaux self-assigned this Jun 29, 2020
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jul 1, 2020
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jul 1, 2020
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jul 1, 2020
With the introduction of OpenSAML into the EnableWebSecurity annotation,
it became necessary to have PowerMock-enabled tests ignore those classes.

Issue spring-projectsgh-8772
jzheaux added a commit that referenced this issue Jul 24, 2020
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 a pull request may close this issue.

1 participant