From 0ca65f86774d6a52a9a5a0e1b759769fbf73ecb9 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 8 Apr 2020 14:27:02 -0600 Subject: [PATCH] Add Missing JavaDoc Issue gh-6019 --- ...aml2WebSsoAuthenticationRequestFilter.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/servlet/filter/Saml2WebSsoAuthenticationRequestFilter.java b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/servlet/filter/Saml2WebSsoAuthenticationRequestFilter.java index be7a13f47a..0d07368347 100644 --- a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/servlet/filter/Saml2WebSsoAuthenticationRequestFilter.java +++ b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/servlet/filter/Saml2WebSsoAuthenticationRequestFilter.java @@ -46,7 +46,27 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; import static org.springframework.util.StringUtils.hasText; /** + * This {@code Filter} formulates a + * SAML 2.0 AuthnRequest (line 1968) + * and redirects to a configured asserting party. + * + *

+ * It supports the + * HTTP-Redirect (line 520) + * and + * HTTP-POST (line 753) + * bindings. + * + *

+ * By default, this {@code Filter} responds to authentication requests + * at the {@code URI} {@code /oauth2/authorization/{registrationId}}. + * The {@code URI} template variable {@code {registrationId}} represents the + * {@link RelyingPartyRegistration#getRegistrationId() registration identifier} of the relying party + * that is used for initiating the authentication request. + * * @since 5.2 + * @author Filip Hanik + * @author Josh Cummings */ public class Saml2WebSsoAuthenticationRequestFilter extends OncePerRequestFilter { @@ -54,21 +74,39 @@ public class Saml2WebSsoAuthenticationRequestFilter extends OncePerRequestFilter private RequestMatcher redirectMatcher = new AntPathRequestMatcher("/saml2/authenticate/{registrationId}"); private Saml2AuthenticationRequestFactory authenticationRequestFactory = new OpenSamlAuthenticationRequestFactory(); + /** + * Construct a {@link Saml2WebSsoAuthenticationRequestFilter} with the provided parameters + * + * @param relyingPartyRegistrationRepository a repository for relying party configurations + */ public Saml2WebSsoAuthenticationRequestFilter(RelyingPartyRegistrationRepository relyingPartyRegistrationRepository) { Assert.notNull(relyingPartyRegistrationRepository, "relyingPartyRegistrationRepository cannot be null"); this.relyingPartyRegistrationRepository = relyingPartyRegistrationRepository; } + /** + * Use the given {@link Saml2AuthenticationRequestFactory} for formulating the SAML 2.0 AuthnRequest + * + * @param authenticationRequestFactory the {@link Saml2AuthenticationRequestFactory} to use + */ public void setAuthenticationRequestFactory(Saml2AuthenticationRequestFactory authenticationRequestFactory) { Assert.notNull(authenticationRequestFactory, "authenticationRequestFactory cannot be null"); this.authenticationRequestFactory = authenticationRequestFactory; } + /** + * Use the given {@link RequestMatcher} that activates this filter for a given request + * + * @param redirectMatcher the {@link RequestMatcher} to use + */ public void setRedirectMatcher(RequestMatcher redirectMatcher) { Assert.notNull(redirectMatcher, "redirectMatcher cannot be null"); this.redirectMatcher = redirectMatcher; } + /** + * {@inheritDoc} + */ @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {