spring-security icon indicating copy to clipboard operation
spring-security copied to clipboard

Add saml2Metadata to the DSL

Open marcusdacoregio opened this issue 3 years ago • 0 comments

In order to publish the metadata endpoint, we should do:

DefaultRelyingPartyRegistrationResolver relyingPartyRegistrationResolver =
        new DefaultRelyingPartyRegistrationResolver(this.relyingPartyRegistrationRepository);
Saml2MetadataFilter filter = new Saml2MetadataFilter(
        relyingPartyRegistrationResolver,
        new OpenSamlMetadataResolver());

http
    // ...
    .saml2Login(withDefaults())
    .addFilterBefore(filter, Saml2WebSsoAuthenticationFilter.class);

It would be nice if we have a new method in the DSL that achieve the same behavior just by doing:

http
    // ...
   .saml2Login(withDefaults())
   .saml2Metadata(withDefaults());

marcusdacoregio avatar Sep 16 '22 14:09 marcusdacoregio