Use consistent "@" tag order in Javadoc
Ensure that Javadoc "@" tags appear in a consistent and well defined order. Issue gh-8945
This commit is contained in:
@@ -44,10 +44,10 @@ import org.springframework.web.filter.DelegatingFilterProxy;
|
||||
* filters necessary for session management, form based login, authorization, etc.
|
||||
* </p>
|
||||
*
|
||||
* @see WebSecurity
|
||||
* @author Rob Winch
|
||||
* @param <O> The object that this builder returns
|
||||
* @param <B> The type of this builder (that is returned by the base class)
|
||||
* @author Rob Winch
|
||||
* @see WebSecurity
|
||||
*/
|
||||
public abstract class AbstractConfiguredSecurityBuilder<O, B extends SecurityBuilder<O>>
|
||||
extends AbstractSecurityBuilder<O> {
|
||||
|
||||
@@ -18,9 +18,9 @@ package org.springframework.security.config.annotation;
|
||||
/**
|
||||
* Interface for building an Object
|
||||
*
|
||||
* @param <O> The type of the Object being built
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @param <O> The type of the Object being built
|
||||
*/
|
||||
public interface SecurityBuilder<O> {
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ package org.springframework.security.config.annotation;
|
||||
* {@link #init(SecurityBuilder)} methods have been invoked, each
|
||||
* {@link #configure(SecurityBuilder)} method is invoked.
|
||||
*
|
||||
* @see AbstractConfiguredSecurityBuilder
|
||||
* @author Rob Winch
|
||||
* @param <O> The object being built by the {@link SecurityBuilder} B
|
||||
* @param <B> The {@link SecurityBuilder} that builds objects of type O. This is also the
|
||||
* {@link SecurityBuilder} that is being configured.
|
||||
* @author Rob Winch
|
||||
* @see AbstractConfiguredSecurityBuilder
|
||||
*/
|
||||
public interface SecurityConfigurer<O, B extends SecurityBuilder<O>> {
|
||||
|
||||
|
||||
@@ -27,11 +27,11 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
* {@link SecurityConfigurer} and when done gaining access to the {@link SecurityBuilder}
|
||||
* that is being configured.
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Wallace Wadge
|
||||
* @param <O> The Object being built by B
|
||||
* @param <B> The Builder that is building O and is configured by
|
||||
* {@link SecurityConfigurerAdapter}
|
||||
* @author Rob Winch
|
||||
* @author Wallace Wadge
|
||||
*/
|
||||
public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>> implements SecurityConfigurer<O, B> {
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ import org.springframework.security.config.annotation.SecurityBuilder;
|
||||
/**
|
||||
* Interface for operating on a SecurityBuilder that creates a {@link ProviderManager}
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @param <B> the type of the {@link SecurityBuilder}
|
||||
* @author Rob Winch
|
||||
*/
|
||||
public interface ProviderManagerBuilder<B extends ProviderManagerBuilder<B>>
|
||||
extends SecurityBuilder<AuthenticationManager> {
|
||||
|
||||
@@ -26,12 +26,11 @@ import org.springframework.security.core.userdetails.UserDetailsPasswordService;
|
||||
/**
|
||||
* Allows configuring a {@link DaoAuthenticationProvider}
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @param <B> the type of the {@link SecurityBuilder}
|
||||
* @param <C> the type of {@link AbstractDaoAuthenticationConfigurer} this is
|
||||
* @param <U> The type of {@link UserDetailsService} that is being used
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
abstract class AbstractDaoAuthenticationConfigurer<B extends ProviderManagerBuilder<B>, C extends AbstractDaoAuthenticationConfigurer<B, C, U>, U extends UserDetailsService>
|
||||
extends UserDetailsAwareConfigurer<B, U> {
|
||||
|
||||
@@ -22,11 +22,10 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
/**
|
||||
* Allows configuring a {@link DaoAuthenticationProvider}
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @param <B> The type of {@link ProviderManagerBuilder} this is
|
||||
* @param <U> The type of {@link UserDetailsService} that is being used
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
public class DaoAuthenticationConfigurer<B extends ProviderManagerBuilder<B>, U extends UserDetailsService>
|
||||
extends AbstractDaoAuthenticationConfigurer<B, DaoAuthenticationConfigurer<B, U>, U> {
|
||||
|
||||
@@ -25,9 +25,9 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
* Base class that allows access to the {@link UserDetailsService} for using as a default
|
||||
* value with {@link AuthenticationManagerBuilder}.
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @param <B> the type of the {@link ProviderManagerBuilder}
|
||||
* @param <U> the type of {@link UserDetailsService}
|
||||
* @author Rob Winch
|
||||
*/
|
||||
public abstract class UserDetailsAwareConfigurer<B extends ProviderManagerBuilder<B>, U extends UserDetailsService>
|
||||
extends SecurityConfigurerAdapter<AuthenticationManager, B> {
|
||||
|
||||
@@ -23,12 +23,12 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
* Allows configuring a {@link UserDetailsService} within a
|
||||
* {@link AuthenticationManagerBuilder}.
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @param <B> the type of the {@link ProviderManagerBuilder}
|
||||
* @param <C> the {@link UserDetailsServiceConfigurer} (or this)
|
||||
* @param <U> the type of UserDetailsService being used to allow for returning the
|
||||
* concrete UserDetailsService.
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
public class UserDetailsServiceConfigurer<B extends ProviderManagerBuilder<B>, C extends UserDetailsServiceConfigurer<B, C, U>, U extends UserDetailsService>
|
||||
extends AbstractDaoAuthenticationConfigurer<B, C, U> {
|
||||
|
||||
@@ -195,7 +195,7 @@ public class RSocketSecurity {
|
||||
/**
|
||||
* Adds authentication with BasicAuthenticationPayloadExchangeConverter.
|
||||
* @param basic
|
||||
* @return
|
||||
* @return this instance
|
||||
* @deprecated Use {@link #simpleAuthentication(Customizer)}
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
@@ -44,8 +44,8 @@ import org.springframework.security.web.session.ConcurrentSessionFilter;
|
||||
import org.springframework.security.web.session.SessionManagementFilter;
|
||||
|
||||
/**
|
||||
* @author Rob Winch
|
||||
* @param <H>
|
||||
* @author Rob Winch
|
||||
*/
|
||||
public interface HttpSecurityBuilder<H extends HttpSecurityBuilder<H>>
|
||||
extends SecurityBuilder<DefaultSecurityFilterChain> {
|
||||
|
||||
@@ -32,10 +32,10 @@ import org.springframework.security.web.SecurityFilterChain;
|
||||
* will automatically be applied to the {@link WebSecurity} by the
|
||||
* {@link EnableWebSecurity} annotation.
|
||||
*
|
||||
* @see WebSecurityConfigurerAdapter
|
||||
* @see SecurityFilterChain
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @see WebSecurityConfigurerAdapter
|
||||
* @see SecurityFilterChain
|
||||
*/
|
||||
public interface WebSecurityConfigurer<T extends SecurityBuilder<Filter>> extends SecurityConfigurer<Filter, T> {
|
||||
|
||||
|
||||
@@ -231,11 +231,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* </pre>
|
||||
* @return the {@link OpenIDLoginConfigurer} for further customizations.
|
||||
* @throws Exception
|
||||
* @deprecated The OpenID 1.0 and 2.0 protocols have been deprecated and users are
|
||||
* <a href="https://openid.net/specs/openid-connect-migration-1_0.html">encouraged to
|
||||
* migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
|
||||
* supported by <code>spring-security-oauth2</code>.
|
||||
* @throws Exception
|
||||
* @see OpenIDLoginConfigurer
|
||||
*/
|
||||
public OpenIDLoginConfigurer<HttpSecurity> openidLogin() throws Exception {
|
||||
@@ -351,16 +351,15 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see OpenIDLoginConfigurer
|
||||
* @param openidLoginCustomizer the {@link Customizer} to provide more options for the
|
||||
* {@link OpenIDLoginConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @deprecated The OpenID 1.0 and 2.0 protocols have been deprecated and users are
|
||||
* <a href="https://openid.net/specs/openid-connect-migration-1_0.html">encouraged to
|
||||
* migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
|
||||
* supported by <code>spring-security-oauth2</code>.
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @see OpenIDLoginConfigurer
|
||||
*/
|
||||
public HttpSecurity openidLogin(Customizer<OpenIDLoginConfigurer<HttpSecurity>> openidLoginCustomizer)
|
||||
throws Exception {
|
||||
@@ -797,12 +796,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see #requiresChannel()
|
||||
* @param portMapperCustomizer the {@link Customizer} to provide more options for the
|
||||
* {@link PortMapperConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @see #requiresChannel()
|
||||
*/
|
||||
public HttpSecurity portMapper(Customizer<PortMapperConfigurer<HttpSecurity>> portMapperCustomizer)
|
||||
throws Exception {
|
||||
@@ -1158,10 +1156,9 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* http.authorizeRequests().antMatchers("/**").hasRole("USER").antMatchers("/admin/**")
|
||||
* .hasRole("ADMIN")
|
||||
* </pre>
|
||||
*
|
||||
* @see #requestMatcher(RequestMatcher)
|
||||
* @return the {@link ExpressionUrlAuthorizationConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
* @see #requestMatcher(RequestMatcher)
|
||||
*/
|
||||
public ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry authorizeRequests()
|
||||
throws Exception {
|
||||
@@ -1238,12 +1235,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see #requestMatcher(RequestMatcher)
|
||||
* @param authorizeRequestsCustomizer the {@link Customizer} to provide more options
|
||||
* for the {@link ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @see #requestMatcher(RequestMatcher)
|
||||
*/
|
||||
public HttpSecurity authorizeRequests(
|
||||
Customizer<ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry> authorizeRequestsCustomizer)
|
||||
@@ -1779,10 +1775,9 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see FormLoginConfigurer#loginPage(String)
|
||||
* @return the {@link FormLoginConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
* @see FormLoginConfigurer#loginPage(String)
|
||||
*/
|
||||
public FormLoginConfigurer<HttpSecurity> formLogin() throws Exception {
|
||||
return getOrApply(new FormLoginConfigurer<>());
|
||||
@@ -1842,12 +1837,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see FormLoginConfigurer#loginPage(String)
|
||||
* @param formLoginCustomizer the {@link Customizer} to provide more options for the
|
||||
* {@link FormLoginConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @see FormLoginConfigurer#loginPage(String)
|
||||
*/
|
||||
public HttpSecurity formLogin(Customizer<FormLoginConfigurer<HttpSecurity>> formLoginCustomizer) throws Exception {
|
||||
formLoginCustomizer.customize(getOrApply(new FormLoginConfigurer<>()));
|
||||
@@ -1935,10 +1929,9 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
*
|
||||
* @since 5.2
|
||||
* @return the {@link Saml2LoginConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
* @since 5.2
|
||||
*/
|
||||
public Saml2LoginConfigurer<HttpSecurity> saml2Login() throws Exception {
|
||||
return getOrApply(new Saml2LoginConfigurer<>());
|
||||
@@ -2025,12 +2018,11 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
*
|
||||
* @since 5.2
|
||||
* @param saml2LoginCustomizer the {@link Customizer} to provide more options for the
|
||||
* {@link Saml2LoginConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @since 5.2
|
||||
*/
|
||||
public HttpSecurity saml2Login(Customizer<Saml2LoginConfigurer<HttpSecurity>> saml2LoginCustomizer)
|
||||
throws Exception {
|
||||
@@ -2122,7 +2114,8 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* <p>
|
||||
* For more advanced configuration, see {@link OAuth2LoginConfigurer} for available
|
||||
* options to customize the defaults.
|
||||
*
|
||||
* @return the {@link OAuth2LoginConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
* @since 5.0
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-4.1">Section 4.1 Authorization Code
|
||||
@@ -2132,8 +2125,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* Authorization Code Flow</a>
|
||||
* @see org.springframework.security.oauth2.client.registration.ClientRegistration
|
||||
* @see org.springframework.security.oauth2.client.registration.ClientRegistrationRepository
|
||||
* @return the {@link OAuth2LoginConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
*/
|
||||
public OAuth2LoginConfigurer<HttpSecurity> oauth2Login() throws Exception {
|
||||
return getOrApply(new OAuth2LoginConfigurer<>());
|
||||
@@ -2224,7 +2215,10 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* <p>
|
||||
* For more advanced configuration, see {@link OAuth2LoginConfigurer} for available
|
||||
* options to customize the defaults.
|
||||
*
|
||||
* @param oauth2LoginCustomizer the {@link Customizer} to provide more options for the
|
||||
* {@link OAuth2LoginConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-4.1">Section 4.1 Authorization Code
|
||||
* Grant</a>
|
||||
@@ -2233,10 +2227,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* Authorization Code Flow</a>
|
||||
* @see org.springframework.security.oauth2.client.registration.ClientRegistration
|
||||
* @see org.springframework.security.oauth2.client.registration.ClientRegistrationRepository
|
||||
* @param oauth2LoginCustomizer the {@link Customizer} to provide more options for the
|
||||
* {@link OAuth2LoginConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
*/
|
||||
public HttpSecurity oauth2Login(Customizer<OAuth2LoginConfigurer<HttpSecurity>> oauth2LoginCustomizer)
|
||||
throws Exception {
|
||||
@@ -2246,13 +2236,12 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
|
||||
/**
|
||||
* Configures OAuth 2.0 Client support.
|
||||
*
|
||||
* @return the {@link OAuth2ClientConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
* @since 5.1
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-1.1">OAuth 2.0 Authorization
|
||||
* Framework</a>
|
||||
* @return the {@link OAuth2ClientConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
*/
|
||||
public OAuth2ClientConfigurer<HttpSecurity> oauth2Client() throws Exception {
|
||||
OAuth2ClientConfigurer<HttpSecurity> configurer = getOrApply(new OAuth2ClientConfigurer<>());
|
||||
@@ -2283,14 +2272,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-1.1">OAuth 2.0 Authorization
|
||||
* Framework</a>
|
||||
* @param oauth2ClientCustomizer the {@link Customizer} to provide more options for
|
||||
* the {@link OAuth2ClientConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-1.1">OAuth 2.0 Authorization
|
||||
* Framework</a>
|
||||
*/
|
||||
public HttpSecurity oauth2Client(Customizer<OAuth2ClientConfigurer<HttpSecurity>> oauth2ClientCustomizer)
|
||||
throws Exception {
|
||||
@@ -2300,13 +2288,12 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
|
||||
/**
|
||||
* Configures OAuth 2.0 Resource Server support.
|
||||
*
|
||||
* @return the {@link OAuth2ResourceServerConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
* @since 5.1
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-1.1">OAuth 2.0 Authorization
|
||||
* Framework</a>
|
||||
* @return the {@link OAuth2ResourceServerConfigurer} for further customizations
|
||||
* @throws Exception
|
||||
*/
|
||||
public OAuth2ResourceServerConfigurer<HttpSecurity> oauth2ResourceServer() throws Exception {
|
||||
OAuth2ResourceServerConfigurer<HttpSecurity> configurer = getOrApply(
|
||||
@@ -2353,14 +2340,13 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-1.1">OAuth 2.0 Authorization
|
||||
* Framework</a>
|
||||
* @param oauth2ResourceServerCustomizer the {@link Customizer} to provide more
|
||||
* options for the {@link OAuth2ResourceServerConfigurer}
|
||||
* @return the {@link HttpSecurity} for further customizations
|
||||
* @throws Exception
|
||||
* @see <a target="_blank" href=
|
||||
* "https://tools.ietf.org/html/rfc6749#section-1.1">OAuth 2.0 Authorization
|
||||
* Framework</a>
|
||||
*/
|
||||
public HttpSecurity oauth2ResourceServer(
|
||||
Customizer<OAuth2ResourceServerConfigurer<HttpSecurity>> oauth2ResourceServerCustomizer) throws Exception {
|
||||
|
||||
@@ -72,11 +72,11 @@ import org.springframework.web.filter.DelegatingFilterProxy;
|
||||
* {@link WebSecurityConfigurerAdapter}.
|
||||
* </p>
|
||||
*
|
||||
* @see EnableWebSecurity
|
||||
* @see WebSecurityConfiguration
|
||||
* @author Rob Winch
|
||||
* @author Evgeniy Cheban
|
||||
* @since 3.2
|
||||
* @see EnableWebSecurity
|
||||
* @see WebSecurityConfiguration
|
||||
*/
|
||||
public final class WebSecurity extends AbstractConfiguredSecurityBuilder<Filter, WebSecurity>
|
||||
implements SecurityBuilder<Filter>, ApplicationContextAware {
|
||||
|
||||
@@ -49,13 +49,13 @@ import java.util.Collections;
|
||||
* Base class for configuring {@link AbstractAuthenticationFilterConfigurer}. This is
|
||||
* intended for internal use only.
|
||||
*
|
||||
* @see FormLoginConfigurer
|
||||
* @see OpenIDLoginConfigurer
|
||||
* @param T refers to "this" for returning the current configurer
|
||||
* @param F refers to the {@link AbstractAuthenticationProcessingFilter} that is being
|
||||
* built
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @see FormLoginConfigurer
|
||||
* @see OpenIDLoginConfigurer
|
||||
*/
|
||||
public abstract class AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>, T extends AbstractAuthenticationFilterConfigurer<B, T, F>, F extends AbstractAuthenticationProcessingFilter>
|
||||
extends AbstractHttpConfigurer<T, B> {
|
||||
|
||||
@@ -28,9 +28,9 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
|
||||
* A base class for registering {@link RequestMatcher}'s. For example, it might allow for
|
||||
* specifying which {@link RequestMatcher} require a certain level of authorization.
|
||||
*
|
||||
* @param <C> The object that is returned or Chained after creating the RequestMatcher
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @param <C> The object that is returned or Chained after creating the RequestMatcher
|
||||
* @see ChannelSecurityConfigurer
|
||||
* @see UrlAuthorizationConfigurer
|
||||
* @see ExpressionUrlAuthorizationConfigurer
|
||||
|
||||
@@ -74,6 +74,7 @@ import org.springframework.util.Assert;
|
||||
* </ul>
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Michael Vitz
|
||||
* @since 3.2
|
||||
*/
|
||||
public final class CsrfConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
@@ -184,12 +185,10 @@ public final class CsrfConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* Specify the {@link SessionAuthenticationStrategy} to use. The default is a
|
||||
* {@link CsrfAuthenticationStrategy}.
|
||||
* </p>
|
||||
*
|
||||
* @author Michael Vitz
|
||||
* @since 5.2
|
||||
* @param sessionAuthenticationStrategy the {@link SessionAuthenticationStrategy} to
|
||||
* use
|
||||
* @return the {@link CsrfConfigurer} for further customizations
|
||||
* @since 5.2
|
||||
*/
|
||||
public CsrfConfigurer<H> sessionAuthenticationStrategy(
|
||||
SessionAuthenticationStrategy sessionAuthenticationStrategy) {
|
||||
@@ -300,10 +299,8 @@ public final class CsrfConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
/**
|
||||
* Gets the {@link SessionAuthenticationStrategy} to use. If none was set by the user
|
||||
* a {@link CsrfAuthenticationStrategy} is created.
|
||||
*
|
||||
* @author Michael Vitz
|
||||
* @since 5.2
|
||||
* @return the {@link SessionAuthenticationStrategy}
|
||||
* @since 5.2
|
||||
*/
|
||||
private SessionAuthenticationStrategy getSessionAuthenticationStrategy() {
|
||||
if (sessionAuthenticationStrategy != null) {
|
||||
|
||||
@@ -61,9 +61,9 @@ import java.util.function.Function;
|
||||
* {@link DefaultLoginPageConfigurer} should be added and how to configure it.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see WebSecurityConfigurerAdapter
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @see WebSecurityConfigurerAdapter
|
||||
*/
|
||||
public final class DefaultLoginPageConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
extends AbstractHttpConfigurer<DefaultLoginPageConfigurer<H>, H> {
|
||||
|
||||
@@ -774,11 +774,10 @@ public class HeadersConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* <li>Content-Security-Policy</li>
|
||||
* <li>Content-Security-Policy-Report-Only</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see ContentSecurityPolicyHeaderWriter
|
||||
* @since 4.1
|
||||
* @return the {@link ContentSecurityPolicyConfig} for additional configuration
|
||||
* @throws IllegalArgumentException if policyDirectives is null or empty
|
||||
* @since 4.1
|
||||
* @see ContentSecurityPolicyHeaderWriter
|
||||
*/
|
||||
public ContentSecurityPolicyConfig contentSecurityPolicy(String policyDirectives) {
|
||||
this.contentSecurityPolicy.writer = new ContentSecurityPolicyHeaderWriter(policyDirectives);
|
||||
@@ -805,11 +804,10 @@ public class HeadersConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* <li>Content-Security-Policy</li>
|
||||
* <li>Content-Security-Policy-Report-Only</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see ContentSecurityPolicyHeaderWriter
|
||||
* @param contentSecurityCustomizer the {@link Customizer} to provide more options for
|
||||
* the {@link ContentSecurityPolicyConfig}
|
||||
* @return the {@link HeadersConfigurer} for additional customizations
|
||||
* @see ContentSecurityPolicyHeaderWriter
|
||||
*/
|
||||
public HeadersConfigurer<H> contentSecurityPolicy(
|
||||
Customizer<ContentSecurityPolicyConfig> contentSecurityCustomizer) {
|
||||
@@ -944,10 +942,9 @@ public class HeadersConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* <pre>
|
||||
* Referrer-Policy: no-referrer
|
||||
* </pre>
|
||||
*
|
||||
* @see ReferrerPolicyHeaderWriter
|
||||
* @since 4.2
|
||||
* @return the {@link ReferrerPolicyConfig} for additional configuration
|
||||
* @since 4.2
|
||||
* @see ReferrerPolicyHeaderWriter
|
||||
*/
|
||||
public ReferrerPolicyConfig referrerPolicy() {
|
||||
this.referrerPolicy.writer = new ReferrerPolicyHeaderWriter();
|
||||
@@ -967,11 +964,10 @@ public class HeadersConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* <ul>
|
||||
* <li>Referrer-Policy</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see ReferrerPolicyHeaderWriter
|
||||
* @since 4.2
|
||||
* @return the {@link ReferrerPolicyConfig} for additional configuration
|
||||
* @throws IllegalArgumentException if policy is null or empty
|
||||
* @since 4.2
|
||||
* @see ReferrerPolicyHeaderWriter
|
||||
*/
|
||||
public ReferrerPolicyConfig referrerPolicy(ReferrerPolicy policy) {
|
||||
this.referrerPolicy.writer = new ReferrerPolicyHeaderWriter(policy);
|
||||
@@ -991,11 +987,10 @@ public class HeadersConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* <ul>
|
||||
* <li>Referrer-Policy</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see ReferrerPolicyHeaderWriter
|
||||
* @param referrerPolicyCustomizer the {@link Customizer} to provide more options for
|
||||
* the {@link ReferrerPolicyConfig}
|
||||
* @return the {@link HeadersConfigurer} for additional customizations
|
||||
* @see ReferrerPolicyHeaderWriter
|
||||
*/
|
||||
public HeadersConfigurer<H> referrerPolicy(Customizer<ReferrerPolicyConfig> referrerPolicyCustomizer) {
|
||||
this.referrerPolicy.writer = new ReferrerPolicyHeaderWriter();
|
||||
@@ -1036,11 +1031,10 @@ public class HeadersConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* <p>
|
||||
* Configuration is provided to the {@link FeaturePolicyHeaderWriter} which is
|
||||
* responsible for writing the header.
|
||||
*
|
||||
* @see FeaturePolicyHeaderWriter
|
||||
* @since 5.1
|
||||
* @return the {@link FeaturePolicyConfig} for additional configuration
|
||||
* @throws IllegalArgumentException if policyDirectives is {@code null} or empty
|
||||
* @since 5.1
|
||||
* @see FeaturePolicyHeaderWriter
|
||||
*/
|
||||
public FeaturePolicyConfig featurePolicy(String policyDirectives) {
|
||||
this.featurePolicy.writer = new FeaturePolicyHeaderWriter(policyDirectives);
|
||||
|
||||
@@ -143,11 +143,10 @@ public final class LogoutConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* attacks</a>. If you really want to use an HTTP GET, you can use
|
||||
* <code>logoutRequestMatcher(new AntPathRequestMatcher(logoutUrl, "GET"));</code>
|
||||
* </p>
|
||||
*
|
||||
* @see #logoutRequestMatcher(RequestMatcher)
|
||||
* @see HttpSecurity#csrf()
|
||||
* @param logoutUrl the URL that will invoke logout.
|
||||
* @return the {@link LogoutConfigurer} for further customization
|
||||
* @see #logoutRequestMatcher(RequestMatcher)
|
||||
* @see HttpSecurity#csrf()
|
||||
*/
|
||||
public LogoutConfigurer<H> logoutUrl(String logoutUrl) {
|
||||
this.logoutRequestMatcher = null;
|
||||
@@ -158,11 +157,10 @@ public final class LogoutConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
/**
|
||||
* The RequestMatcher that triggers log out to occur. In most circumstances users will
|
||||
* use {@link #logoutUrl(String)} which helps enforce good practices.
|
||||
*
|
||||
* @see #logoutUrl(String)
|
||||
* @param logoutRequestMatcher the RequestMatcher used to determine if logout should
|
||||
* occur.
|
||||
* @return the {@link LogoutConfigurer} for further customization
|
||||
* @see #logoutUrl(String)
|
||||
*/
|
||||
public LogoutConfigurer<H> logoutRequestMatcher(RequestMatcher logoutRequestMatcher) {
|
||||
this.logoutRequestMatcher = logoutRequestMatcher;
|
||||
|
||||
@@ -214,8 +214,8 @@ public final class SessionManagementConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
* @param sessionCreationPolicy the {@link SessionCreationPolicy} to use. Cannot be
|
||||
* null.
|
||||
* @return the {@link SessionManagementConfigurer} for further customizations
|
||||
* @see SessionCreationPolicy
|
||||
* @throws IllegalArgumentException if {@link SessionCreationPolicy} is null.
|
||||
* @see SessionCreationPolicy
|
||||
*/
|
||||
public SessionManagementConfigurer<H> sessionCreationPolicy(SessionCreationPolicy sessionCreationPolicy) {
|
||||
Assert.notNull(sessionCreationPolicy, "sessionCreationPolicy cannot be null");
|
||||
|
||||
@@ -163,10 +163,9 @@ public final class OAuth2LoginConfigurer<B extends HttpSecurityBuilder<B>>
|
||||
|
||||
/**
|
||||
* Sets the repository for authorized client(s).
|
||||
*
|
||||
* @since 5.1
|
||||
* @param authorizedClientRepository the authorized client repository
|
||||
* @return the {@link OAuth2LoginConfigurer} for further configuration
|
||||
* @since 5.1
|
||||
*/
|
||||
public OAuth2LoginConfigurer<B> authorizedClientRepository(
|
||||
OAuth2AuthorizedClientRepository authorizedClientRepository) {
|
||||
@@ -250,11 +249,10 @@ public final class OAuth2LoginConfigurer<B extends HttpSecurityBuilder<B>>
|
||||
|
||||
/**
|
||||
* Sets the resolver used for resolving {@link OAuth2AuthorizationRequest}'s.
|
||||
*
|
||||
* @since 5.1
|
||||
* @param authorizationRequestResolver the resolver used for resolving
|
||||
* {@link OAuth2AuthorizationRequest}'s
|
||||
* @return the {@link AuthorizationEndpointConfig} for further configuration
|
||||
* @since 5.1
|
||||
*/
|
||||
public AuthorizationEndpointConfig authorizationRequestResolver(
|
||||
OAuth2AuthorizationRequestResolver authorizationRequestResolver) {
|
||||
|
||||
@@ -118,11 +118,11 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
|
||||
* </ul>
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
* @deprecated The OpenID 1.0 and 2.0 protocols have been deprecated and users are
|
||||
* <a href="https://openid.net/specs/openid-connect-migration-1_0.html">encouraged to
|
||||
* migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
|
||||
* supported by <code>spring-security-oauth2</code>.
|
||||
* @since 3.2
|
||||
*/
|
||||
public final class OpenIDLoginConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
extends AbstractAuthenticationFilterConfigurer<H, OpenIDLoginConfigurer<H>, OpenIDAuthenticationFilter> {
|
||||
|
||||
@@ -40,8 +40,8 @@ import org.springframework.util.StringUtils;
|
||||
* Allows mapping security constraints using {@link MessageMatcher} to the security
|
||||
* expressions.
|
||||
*
|
||||
* @since 4.0
|
||||
* @author Rob Winch
|
||||
* @since 4.0
|
||||
*/
|
||||
public class MessageSecurityMetadataSourceRegistry {
|
||||
|
||||
@@ -152,7 +152,7 @@ public class MessageSecurityMetadataSourceRegistry {
|
||||
* from. Uses
|
||||
* {@link MessageSecurityMetadataSourceRegistry#simpDestPathMatcher(PathMatcher)}.
|
||||
* @return the {@link Constraint} that is associated to the {@link MessageMatcher}
|
||||
* @see {@link MessageSecurityMetadataSourceRegistry#simpDestPathMatcher(PathMatcher)}
|
||||
* @see MessageSecurityMetadataSourceRegistry#simpDestPathMatcher(PathMatcher)
|
||||
*/
|
||||
private Constraint simpDestMatchers(SimpMessageType type, String... patterns) {
|
||||
List<MatcherBuilder> matchers = new ArrayList<>(patterns.length);
|
||||
|
||||
@@ -47,6 +47,7 @@ import java.lang.annotation.Target;
|
||||
* return new MapReactiveUserDetailsService(user);
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Below is the same as our minimal configuration, but explicitly declaring the
|
||||
* {@code ServerHttpSecurity}.
|
||||
@@ -54,7 +55,6 @@ import java.lang.annotation.Target;
|
||||
* <pre class="code">
|
||||
* @EnableWebFluxSecurity
|
||||
* public class MyExplicitSecurityConfiguration {
|
||||
* // @formatter:off
|
||||
* @Bean
|
||||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
@@ -65,9 +65,7 @@ import java.lang.annotation.Target;
|
||||
* .formLogin();
|
||||
* return http.build();
|
||||
* }
|
||||
* // @formatter:on
|
||||
*
|
||||
* // @formatter:off
|
||||
* @Bean
|
||||
* public MapReactiveUserDetailsService userDetailsService() {
|
||||
* UserDetails user = User.withDefaultPasswordEncoder()
|
||||
@@ -77,8 +75,8 @@ import java.lang.annotation.Target;
|
||||
* .build();
|
||||
* return new MapReactiveUserDetailsService(user);
|
||||
* }
|
||||
* // @formatter:on
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 5.0
|
||||
|
||||
@@ -447,13 +447,13 @@ final class AuthenticationConfigBuilder {
|
||||
|
||||
/**
|
||||
* Parses OpenID 1.0 and 2.0 - related parts of configuration xmls
|
||||
* @param sessionStrategy sessionStrategy
|
||||
* @param openIDLoginElt the element from the xml file
|
||||
* @return the parsed filter as rootBeanDefinition
|
||||
* @deprecated The OpenID 1.0 and 2.0 protocols have been deprecated and users are
|
||||
* <a href="https://openid.net/specs/openid-connect-migration-1_0.html">encouraged to
|
||||
* migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
|
||||
* supported by <code>spring-security-oauth2</code>.
|
||||
* @param sessionStrategy sessionStrategy
|
||||
* @param openIDLoginElt the element from the xml file
|
||||
* @return the parsed filter as rootBeanDefinition
|
||||
*/
|
||||
private RootBeanDefinition parseOpenIDFilter(BeanReference sessionStrategy, Element openIDLoginElt) {
|
||||
RootBeanDefinition openIDFilter;
|
||||
|
||||
@@ -55,8 +55,8 @@ import org.springframework.util.xml.DomUtils;
|
||||
* A {@link BeanDefinitionParser} for <http>'s <oauth2-resource-server>
|
||||
* element.
|
||||
*
|
||||
* @since 5.3
|
||||
* @author Josh Cummings
|
||||
* @since 5.3
|
||||
*/
|
||||
final class OAuth2ResourceServerBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Checks for the presence of a ContextSource instance. Also supplies the standard
|
||||
* reference to any unconfigured <ldap-authentication-provider> or <ldap-user-service>
|
||||
* beans. This is necessary in cases where the user has given the server a specific Id,
|
||||
* but hasn't used the server-ref attribute to link this to the other ldap definitions.
|
||||
* See SEC-799.
|
||||
* reference to any unconfigured <ldap-authentication-provider> or
|
||||
* <ldap-user-service> beans. This is necessary in cases where the user has given
|
||||
* the server a specific Id, but hasn't used the server-ref attribute to link this to the
|
||||
* other ldap definitions. See SEC-799.
|
||||
*
|
||||
* @author Luke Taylor
|
||||
* @since 3.0
|
||||
|
||||
@@ -189,25 +189,51 @@ import static org.springframework.security.web.server.DelegatingServerAuthentica
|
||||
*
|
||||
* A minimal configuration can be found below:
|
||||
*
|
||||
* <pre class="code"> @EnableWebFluxSecurity public class
|
||||
* MyMinimalSecurityConfiguration {
|
||||
* <pre class="code">
|
||||
* @EnableWebFluxSecurity
|
||||
* public class MyMinimalSecurityConfiguration {
|
||||
*
|
||||
* @Bean public MapReactiveUserDetailsService userDetailsService() { UserDetails user
|
||||
* = User.withDefaultPasswordEncoder() .username("user") .password("password")
|
||||
* .roles("USER") .build(); return new MapReactiveUserDetailsService(user); } }
|
||||
* @Bean
|
||||
* public MapReactiveUserDetailsService userDetailsService() {
|
||||
* UserDetails user = User.withDefaultPasswordEncoder()
|
||||
* .username("user")
|
||||
* .password("password")
|
||||
* .roles("USER")
|
||||
* .build();
|
||||
* return new MapReactiveUserDetailsService(user);
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Below is the same as our minimal configuration, but explicitly declaring the
|
||||
* {@code ServerHttpSecurity}.
|
||||
*
|
||||
* <pre class="code"> @EnableWebFluxSecurity public class
|
||||
* MyExplicitSecurityConfiguration { @Bean public SecurityWebFilterChain
|
||||
* springSecurityFilterChain(ServerHttpSecurity http) { http .authorizeExchange()
|
||||
* .anyExchange().authenticated() .and() .httpBasic().and() .formLogin(); return
|
||||
* http.build(); }
|
||||
* <pre class="code">
|
||||
* @EnableWebFluxSecurity
|
||||
* public class MyExplicitSecurityConfiguration {
|
||||
*
|
||||
* @Bean public MapReactiveUserDetailsService userDetailsService() { UserDetails user
|
||||
* = User.withDefaultPasswordEncoder() .username("user") .password("password")
|
||||
* .roles("USER") .build(); return new MapReactiveUserDetailsService(user); } }
|
||||
* @Bean
|
||||
* public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
* http
|
||||
* .authorizeExchange()
|
||||
* .anyExchange().authenticated()
|
||||
* .and()
|
||||
* .httpBasic().and()
|
||||
* .formLogin();
|
||||
* return http.build();
|
||||
* }
|
||||
*
|
||||
* @Bean
|
||||
* public MapReactiveUserDetailsService userDetailsService() {
|
||||
* UserDetails user = User.withDefaultPasswordEncoder()
|
||||
* .username("user")
|
||||
* .password("password")
|
||||
* .roles("USER")
|
||||
* .build();
|
||||
* return new MapReactiveUserDetailsService(user);
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Vedran Pavic
|
||||
@@ -829,11 +855,10 @@ public class ServerHttpSecurity {
|
||||
* Note that if extractor is not specified, {@link SubjectDnX509PrincipalExtractor}
|
||||
* will be used. If authenticationManager is not specified,
|
||||
* {@link ReactivePreAuthenticatedAuthenticationManager} will be used.
|
||||
*
|
||||
* @since 5.2
|
||||
* @param x509Customizer the {@link Customizer} to provide more options for the
|
||||
* {@link X509Spec}
|
||||
* @return the {@link ServerHttpSecurity} to customize
|
||||
* @since 5.2
|
||||
*/
|
||||
public ServerHttpSecurity x509(Customizer<X509Spec> x509Customizer) {
|
||||
if (this.x509 == null) {
|
||||
@@ -994,10 +1019,9 @@ public class ServerHttpSecurity {
|
||||
* The {@link ServerSecurityContextRepository} used to save the
|
||||
* {@code Authentication}. Defaults to
|
||||
* {@link WebSessionServerSecurityContextRepository}.
|
||||
*
|
||||
* @since 5.2
|
||||
* @param securityContextRepository the repository to use
|
||||
* @return the {@link OAuth2LoginSpec} to continue configuring
|
||||
* @since 5.2
|
||||
*/
|
||||
public OAuth2LoginSpec securityContextRepository(ServerSecurityContextRepository securityContextRepository) {
|
||||
this.securityContextRepository = securityContextRepository;
|
||||
@@ -1008,10 +1032,9 @@ public class ServerHttpSecurity {
|
||||
* The {@link ServerAuthenticationSuccessHandler} used after authentication
|
||||
* success. Defaults to {@link RedirectServerAuthenticationSuccessHandler}
|
||||
* redirecting to "/".
|
||||
*
|
||||
* @since 5.2
|
||||
* @param authenticationSuccessHandler the success handler to use
|
||||
* @return the {@link OAuth2LoginSpec} to customize
|
||||
* @since 5.2
|
||||
*/
|
||||
public OAuth2LoginSpec authenticationSuccessHandler(
|
||||
ServerAuthenticationSuccessHandler authenticationSuccessHandler) {
|
||||
@@ -1024,10 +1047,9 @@ public class ServerHttpSecurity {
|
||||
* The {@link ServerAuthenticationFailureHandler} used after authentication
|
||||
* failure. Defaults to {@link RedirectServerAuthenticationFailureHandler}
|
||||
* redirecting to "/login?error".
|
||||
*
|
||||
* @since 5.2
|
||||
* @param authenticationFailureHandler the failure handler to use
|
||||
* @return the {@link OAuth2LoginSpec} to customize
|
||||
* @since 5.2
|
||||
*/
|
||||
public OAuth2LoginSpec authenticationFailureHandler(
|
||||
ServerAuthenticationFailureHandler authenticationFailureHandler) {
|
||||
@@ -1121,11 +1143,10 @@ public class ServerHttpSecurity {
|
||||
|
||||
/**
|
||||
* Sets the repository to use for storing {@link OAuth2AuthorizationRequest}'s.
|
||||
*
|
||||
* @since 5.2
|
||||
* @param authorizationRequestRepository the repository to use for storing
|
||||
* {@link OAuth2AuthorizationRequest}'s
|
||||
* @return the {@link OAuth2LoginSpec} for further configuration
|
||||
* @since 5.2
|
||||
*/
|
||||
public OAuth2LoginSpec authorizationRequestRepository(
|
||||
ServerAuthorizationRequestRepository<OAuth2AuthorizationRequest> authorizationRequestRepository) {
|
||||
@@ -1135,11 +1156,10 @@ public class ServerHttpSecurity {
|
||||
|
||||
/**
|
||||
* Sets the resolver used for resolving {@link OAuth2AuthorizationRequest}'s.
|
||||
*
|
||||
* @since 5.2
|
||||
* @param authorizationRequestResolver the resolver used for resolving
|
||||
* {@link OAuth2AuthorizationRequest}'s
|
||||
* @return the {@link OAuth2LoginSpec} for further configuration
|
||||
* @since 5.2
|
||||
*/
|
||||
public OAuth2LoginSpec authorizationRequestResolver(
|
||||
ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver) {
|
||||
@@ -1150,11 +1170,10 @@ public class ServerHttpSecurity {
|
||||
/**
|
||||
* Sets the {@link ServerWebExchangeMatcher matcher} used for determining if the
|
||||
* request is an authentication request.
|
||||
*
|
||||
* @since 5.2
|
||||
* @param authenticationMatcher the {@link ServerWebExchangeMatcher matcher} used
|
||||
* for determining if the request is an authentication request
|
||||
* @return the {@link OAuth2LoginSpec} for further configuration
|
||||
* @since 5.2
|
||||
*/
|
||||
public OAuth2LoginSpec authenticationMatcher(ServerWebExchangeMatcher authenticationMatcher) {
|
||||
this.authenticationMatcher = authenticationMatcher;
|
||||
@@ -1499,11 +1518,10 @@ public class ServerHttpSecurity {
|
||||
|
||||
/**
|
||||
* Sets the repository to use for storing {@link OAuth2AuthorizationRequest}'s.
|
||||
*
|
||||
* @since 5.2
|
||||
* @param authorizationRequestRepository the repository to use for storing
|
||||
* {@link OAuth2AuthorizationRequest}'s
|
||||
* @return the {@link OAuth2ClientSpec} to customize
|
||||
* @since 5.2
|
||||
*/
|
||||
public OAuth2ClientSpec authorizationRequestRepository(
|
||||
ServerAuthorizationRequestRepository<OAuth2AuthorizationRequest> authorizationRequestRepository) {
|
||||
@@ -3689,8 +3707,8 @@ public class ServerHttpSecurity {
|
||||
/**
|
||||
* Configures {@code Content-Security-Policy} response header.
|
||||
*
|
||||
* @see #contentSecurityPolicy(String)
|
||||
* @since 5.1
|
||||
* @see #contentSecurityPolicy(String)
|
||||
*/
|
||||
public class ContentSecurityPolicySpec {
|
||||
|
||||
@@ -3740,8 +3758,8 @@ public class ServerHttpSecurity {
|
||||
/**
|
||||
* Configures {@code Feature-Policy} response header.
|
||||
*
|
||||
* @see #featurePolicy(String)
|
||||
* @since 5.1
|
||||
* @see #featurePolicy(String)
|
||||
*/
|
||||
public class FeaturePolicySpec {
|
||||
|
||||
@@ -3763,9 +3781,9 @@ public class ServerHttpSecurity {
|
||||
/**
|
||||
* Configures {@code Referrer-Policy} response header.
|
||||
*
|
||||
* @since 5.1
|
||||
* @see #referrerPolicy()
|
||||
* @see #referrerPolicy(ReferrerPolicy)
|
||||
* @since 5.1
|
||||
*/
|
||||
public class ReferrerPolicySpec {
|
||||
|
||||
|
||||
@@ -109,29 +109,29 @@ public class SampleWebSecurityConfigurerAdapterTests {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>
|
||||
* <http>
|
||||
* <intercept-url pattern="/resources/**" access="permitAll"/>
|
||||
* <intercept-url pattern="/**" access="authenticated"/>
|
||||
* <logout
|
||||
* <pre>
|
||||
* <http>
|
||||
* <intercept-url pattern="/resources/**" access="permitAll"/>
|
||||
* <intercept-url pattern="/**" access="authenticated"/>
|
||||
* <logout
|
||||
* logout-success-url="/login?logout"
|
||||
* logout-url="/logout"
|
||||
* <form-login
|
||||
* <form-login
|
||||
* authentication-failure-url="/login?error"
|
||||
* login-page="/login" <!-- Except Spring Security renders the login page -->
|
||||
* login-processing-url="/login" <!-- but only POST -->
|
||||
* login-page="/login" <!-- Except Spring Security renders the login page -->
|
||||
* login-processing-url="/login" <!-- but only POST -->
|
||||
* password-parameter="password"
|
||||
* username-parameter="username"
|
||||
* />
|
||||
* </http>
|
||||
* <authentication-manager>
|
||||
* <authentication-provider>
|
||||
* <user-service>
|
||||
* <user username="user" password="password" authorities="ROLE_USER"/>
|
||||
* </user-service>
|
||||
* </authentication-provider>
|
||||
* </authentication-manager>
|
||||
* </code>
|
||||
* />
|
||||
* </http>
|
||||
* <authentication-manager>
|
||||
* <authentication-provider>
|
||||
* <user-service>
|
||||
* <user username="user" password="password" authorities="ROLE_USER"/>
|
||||
* </user-service>
|
||||
* </authentication-provider>
|
||||
* </authentication-manager>
|
||||
* </pre>
|
||||
*
|
||||
* @author Rob Winch
|
||||
*/
|
||||
@@ -183,35 +183,35 @@ public class SampleWebSecurityConfigurerAdapterTests {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>
|
||||
* <http security="none" pattern="/resources/**"/>
|
||||
* <http>
|
||||
* <intercept-url pattern="/logout" access="permitAll"/>
|
||||
* <intercept-url pattern="/login" access="permitAll"/>
|
||||
* <intercept-url pattern="/signup" access="permitAll"/>
|
||||
* <intercept-url pattern="/about" access="permitAll"/>
|
||||
* <intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
|
||||
* <logout
|
||||
* <pre>
|
||||
* <http security="none" pattern="/resources/**"/>
|
||||
* <http>
|
||||
* <intercept-url pattern="/logout" access="permitAll"/>
|
||||
* <intercept-url pattern="/login" access="permitAll"/>
|
||||
* <intercept-url pattern="/signup" access="permitAll"/>
|
||||
* <intercept-url pattern="/about" access="permitAll"/>
|
||||
* <intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
|
||||
* <logout
|
||||
* logout-success-url="/login?logout"
|
||||
* logout-url="/logout"
|
||||
* <form-login
|
||||
* <form-login
|
||||
* authentication-failure-url="/login?error"
|
||||
* login-page="/login"
|
||||
* login-processing-url="/login" <!-- but only POST -->
|
||||
* login-processing-url="/login" <!-- but only POST -->
|
||||
* password-parameter="password"
|
||||
* username-parameter="username"
|
||||
* />
|
||||
* </http>
|
||||
* <authentication-manager>
|
||||
* <authentication-provider>
|
||||
* <user-service>
|
||||
* <user username="user" password="password" authorities="ROLE_USER"/>
|
||||
* <user username="admin" password="password" authorities=
|
||||
"ROLE_USER,ROLE_ADMIN"/>
|
||||
* </user-service>
|
||||
* </authentication-provider>
|
||||
* </authentication-manager>
|
||||
* </code>
|
||||
* />
|
||||
* </http>
|
||||
* <authentication-manager>
|
||||
* <authentication-provider>
|
||||
* <user-service>
|
||||
* <user username="user" password="password" authorities="ROLE_USER"/>
|
||||
* <user username="admin" password="password" authorities=
|
||||
"ROLE_USER,ROLE_ADMIN"/>
|
||||
* </user-service>
|
||||
* </authentication-provider>
|
||||
* </authentication-manager>
|
||||
* </pre>
|
||||
*
|
||||
* @author Rob Winch
|
||||
*/
|
||||
@@ -319,38 +319,38 @@ public class SampleWebSecurityConfigurerAdapterTests {
|
||||
|
||||
/**
|
||||
* <code>
|
||||
* <http security="none" pattern="/resources/**"/>
|
||||
* <http pattern="/api/**">
|
||||
* <intercept-url pattern="/api/admin/**" access="hasRole('ROLE_ADMIN')"/>
|
||||
* <intercept-url pattern="/api/**" access="hasRole('ROLE_USER')"/>
|
||||
* <http-basic />
|
||||
* </http>
|
||||
* <http>
|
||||
* <intercept-url pattern="/logout" access="permitAll"/>
|
||||
* <intercept-url pattern="/login" access="permitAll"/>
|
||||
* <intercept-url pattern="/signup" access="permitAll"/>
|
||||
* <intercept-url pattern="/about" access="permitAll"/>
|
||||
* <intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
|
||||
* <logout
|
||||
* <http security="none" pattern="/resources/**"/>
|
||||
* <http pattern="/api/**">
|
||||
* <intercept-url pattern="/api/admin/**" access="hasRole('ROLE_ADMIN')"/>
|
||||
* <intercept-url pattern="/api/**" access="hasRole('ROLE_USER')"/>
|
||||
* <http-basic />
|
||||
* </http>
|
||||
* <http>
|
||||
* <intercept-url pattern="/logout" access="permitAll"/>
|
||||
* <intercept-url pattern="/login" access="permitAll"/>
|
||||
* <intercept-url pattern="/signup" access="permitAll"/>
|
||||
* <intercept-url pattern="/about" access="permitAll"/>
|
||||
* <intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
|
||||
* <logout
|
||||
* logout-success-url="/login?logout"
|
||||
* logout-url="/logout"
|
||||
* <form-login
|
||||
* <form-login
|
||||
* authentication-failure-url="/login?error"
|
||||
* login-page="/login"
|
||||
* login-processing-url="/login" <!-- but only POST -->
|
||||
* login-processing-url="/login" <!-- but only POST -->
|
||||
* password-parameter="password"
|
||||
* username-parameter="username"
|
||||
* />
|
||||
* </http>
|
||||
* <authentication-manager>
|
||||
* <authentication-provider>
|
||||
* <user-service>
|
||||
* <user username="user" password="password" authorities="ROLE_USER"/>
|
||||
* <user username="admin" password="password" authorities=
|
||||
"ROLE_USER,ROLE_ADMIN"/>
|
||||
* </user-service>
|
||||
* </authentication-provider>
|
||||
* </authentication-manager>
|
||||
* />
|
||||
* </http>
|
||||
* <authentication-manager>
|
||||
* <authentication-provider>
|
||||
* <user-service>
|
||||
* <user username="user" password="password" authorities="ROLE_USER"/>
|
||||
* <user username="admin" password="password" authorities=
|
||||
"ROLE_USER,ROLE_ADMIN"/>
|
||||
* </user-service>
|
||||
* </authentication-provider>
|
||||
* </authentication-manager>
|
||||
* </code>
|
||||
*
|
||||
* @author Rob Winch
|
||||
|
||||
@@ -63,8 +63,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <http> attributes are present in Java
|
||||
* Config.
|
||||
* Tests to verify that all the functionality of <http> attributes are present in
|
||||
* Java Config.
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Joe Grandja
|
||||
|
||||
@@ -39,7 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <anonymous> attributes is present
|
||||
* Tests to verify that all the functionality of <anonymous> attributes is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -45,7 +45,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <http-basic> attributes is present
|
||||
* Tests to verify that all the functionality of <http-basic> attributes is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -46,7 +46,8 @@ import org.springframework.web.filter.OncePerRequestFilter;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <custom-filter> attributes is present
|
||||
* Tests to verify that all the functionality of <custom-filter> attributes is
|
||||
* present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -45,7 +45,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <expression-handler> attributes is
|
||||
* Tests to verify that all the functionality of <expression-handler> attributes is
|
||||
* present
|
||||
*
|
||||
* @author Rob Winch
|
||||
|
||||
@@ -36,7 +36,8 @@ import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <http-firewall> attributes is present
|
||||
* Tests to verify that all the functionality of <http-firewall> attributes is
|
||||
* present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -45,7 +45,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <form-login> attributes is present
|
||||
* Tests to verify that all the functionality of <form-login> attributes is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -40,7 +40,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <headers> attributes is present
|
||||
* Tests to verify that all the functionality of <headers> attributes is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -41,7 +41,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <intercept-url> attributes is present
|
||||
* Tests to verify that all the functionality of <intercept-url> attributes is
|
||||
* present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -44,7 +44,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <jee> attributes is present
|
||||
* Tests to verify that all the functionality of <jee> attributes is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -48,7 +48,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <logout> attributes is present
|
||||
* Tests to verify that all the functionality of <logout> attributes is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -70,7 +70,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <openid-login> attributes is present
|
||||
* Tests to verify that all the functionality of <openid-login> attributes is
|
||||
* present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -30,7 +30,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <port-mappings> attributes is present
|
||||
* Tests to verify that all the functionality of <port-mappings> attributes is
|
||||
* present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -42,7 +42,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <request-cache> attributes is present
|
||||
* Tests to verify that all the functionality of <request-cache> attributes is
|
||||
* present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -43,8 +43,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <access-denied-handler> attributes is
|
||||
* present
|
||||
* Tests to verify that all the functionality of <access-denied-handler> attributes
|
||||
* is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -51,8 +51,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <x509> attributes is present in Java
|
||||
* config
|
||||
* Tests to verify that all the functionality of <x509> attributes is present in
|
||||
* Java config
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
@@ -63,7 +63,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* Tests to verify that all the functionality of <anonymous> attributes is present
|
||||
* Tests to verify that all the functionality of <anonymous> attributes is present
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @author Josh Cummings
|
||||
|
||||
Reference in New Issue
Block a user