config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java
public SecurityWebFilterChain build() {
		if (this.built != null) {
			throw new IllegalStateException("This has already been built with the following stacktrace. " + buildToString());
		}
		this.built = new RuntimeException("First Build Invocation").fillInStackTrace();
		if (this.headers != null) {
			this.headers.configure(this);
		}
		WebFilter securityContextRepositoryWebFilter = securityContextRepositoryWebFilter();
		if (securityContextRepositoryWebFilter != null) {
			this.webFilters.add(securityContextRepositoryWebFilter);
		}
		if (this.httpsRedirectSpec != null) {
			this.httpsRedirectSpec.configure(this);
		}
		if (this.x509 != null) {
			this.x509.configure(this);
		}
		if (this.csrf != null) {
			this.csrf.configure(this);
		}
		if (this.cors != null) {
			this.cors.configure(this);
		}
		if (this.httpBasic != null) {
			this.httpBasic.authenticationManager(this.authenticationManager);
			this.httpBasic.configure(this);
		}
		if (this.formLogin != null) {
			this.formLogin.authenticationManager(this.authenticationManager);
			if (this.securityContextRepository != null) {
				this.formLogin.securityContextRepository(this.securityContextRepository);
			}
			this.formLogin.configure(this);
		}
		if (this.oauth2Login != null) {
			this.oauth2Login.configure(this);
		}
		if (this.resourceServer != null) {
			this.resourceServer.configure(this);
		}
		if (this.client != null) {
			this.client.configure(this);
		}
		if (this.anonymous != null) {
			this.anonymous.configure(this);
		}
		this.loginPage.configure(this);
		if (this.logout != null) {
			this.logout.configure(this);
		}
		this.requestCache.configure(this);
		this.addFilterAt(new SecurityContextServerWebExchangeWebFilter(), SecurityWebFiltersOrder.SECURITY_CONTEXT_SERVER_WEB_EXCHANGE);
		if (this.authorizeExchange != null) {
			ServerAuthenticationEntryPoint authenticationEntryPoint = getAuthenticationEntryPoint();
			ExceptionTranslationWebFilter exceptionTranslationWebFilter = new ExceptionTranslationWebFilter();
			if (authenticationEntryPoint != null) {
				exceptionTranslationWebFilter.setAuthenticationEntryPoint(
					authenticationEntryPoint);
			}
			ServerAccessDeniedHandler accessDeniedHandler = getAccessDeniedHandler();
			if (accessDeniedHandler != null) {
				exceptionTranslationWebFilter.setAccessDeniedHandler(
						accessDeniedHandler);
			}
			this.addFilterAt(exceptionTranslationWebFilter, SecurityWebFiltersOrder.EXCEPTION_TRANSLATION);
			this.authorizeExchange.configure(this);
		}
		AnnotationAwareOrderComparator.sort(this.webFilters);
		List<WebFilter> sortedWebFilters = new ArrayList<>();
		this.webFilters.forEach( f -> {
			if (f instanceof OrderedWebFilter) {
				f = ((OrderedWebFilter) f).webFilter;
			}
			sortedWebFilters.add(f);
		});
		sortedWebFilters.add(0, new ServerWebExchangeReactorContextWebFilter());
		return new MatcherSecurityWebFilterChain(getSecurityMatcher(), sortedWebFilters);
	}
public SecurityWebFilterChain build() {
		if (this.built != null) {
			throw new IllegalStateException("This has already been built with the following stacktrace. " + buildToString());
		}
		this.built = new RuntimeException("First Build Invocation").fillInStackTrace();
		if (this.headers != null) {
			this.headers.configure(this);
		}
		WebFilter securityContextRepositoryWebFilter = securityContextRepositoryWebFilter();
		if (securityContextRepositoryWebFilter != null) {
			this.webFilters.add(securityContextRepositoryWebFilter);
		}
		if (this.httpsRedirectSpec != null) {
			this.httpsRedirectSpec.configure(this);
		}
		if (this.x509 != null) {
			this.x509.configure(this);
		}
		if (this.csrf != null) {
			this.csrf.configure(this);
		}
		if (this.cors != null) {
			this.cors.configure(this);
		}
		if (this.httpBasic != null) {
			this.httpBasic.authenticationManager(this.authenticationManager);
			this.httpBasic.configure(this);
		}
		if (this.formLogin != null) {
			this.formLogin.authenticationManager(this.authenticationManager);
			if (this.securityContextRepository != null) {
				this.formLogin.securityContextRepository(this.securityContextRepository);
			}
			this.formLogin.configure(this);
		}
		if (this.oauth2Login != null) {
			this.oauth2Login.configure(this);
		}
		if (this.resourceServer != null) {
			this.resourceServer.configure(this);
		}
		if (this.client != null) {
			this.client.configure(this);
		}
		if (this.anonymous != null) {
			this.anonymous.configure(this);
		}
		this.loginPage.configure(this);
		if (this.logout != null) {
			this.logout.configure(this);
		}
		this.requestCache.configure(this);
		this.addFilterAt(new SecurityContextServerWebExchangeWebFilter(), SecurityWebFiltersOrder.SECURITY_CONTEXT_SERVER_WEB_EXCHANGE);
		if (this.authorizeExchange != null) {
			ServerAuthenticationEntryPoint authenticationEntryPoint = getAuthenticationEntryPoint();
			ExceptionTranslationWebFilter exceptionTranslationWebFilter = new ExceptionTranslationWebFilter();
			if (authenticationEntryPoint != null) {
				exceptionTranslationWebFilter.setAuthenticationEntryPoint(
					authenticationEntryPoint);
			}
			ServerAccessDeniedHandler accessDeniedHandler = getAccessDeniedHandler();
			if (accessDeniedHandler != null) {
				exceptionTranslationWebFilter.setAccessDeniedHandler(
						accessDeniedHandler);
			}
			this.addFilterAt(exceptionTranslationWebFilter, SecurityWebFiltersOrder.EXCEPTION_TRANSLATION);
			this.authorizeExchange.configure(this);
		}
		AnnotationAwareOrderComparator.sort(this.webFilters);
		List<WebFilter> sortedWebFilters = new ArrayList<>();
		this.webFilters.forEach( f -> {
			if (f instanceof OrderedWebFilter) {
				f = ((OrderedWebFilter) f).webFilter;
			}
			sortedWebFilters.add(f);
		});
		sortedWebFilters.add(0, new ServerWebExchangeReactorContextWebFilter());
		return new MatcherSecurityWebFilterChain(getSecurityMatcher(), sortedWebFilters);
	}
public SecurityWebFilterChain build ( ) { if ( this . built != null ) { throw new IllegalStateException ( "This has already been built with the following stacktrace. " + buildToString ( ) ) ; } this . built = new RuntimeException ( "First Build Invocation" ) . fillInStackTrace ( ) ; if ( this . headers != null ) { this . headers . configure ( this ) ; } WebFilter securityContextRepositoryWebFilter = securityContextRepositoryWebFilter ( ) ; if ( securityContextRepositoryWebFilter != null ) { this . webFilters . add ( securityContextRepositoryWebFilter ) ; } if ( this . httpsRedirectSpec != null ) { this . httpsRedirectSpec . configure ( this ) ; } if ( this . x509 != null ) { this . x509 . configure ( this ) ; } if ( this . csrf != null ) { this . csrf . configure ( this ) ; } if ( this . cors != null ) { this . cors . configure ( this ) ; } if ( this . httpBasic != null ) { this . httpBasic . authenticationManager ( this . authenticationManager ) ; this . httpBasic . configure ( this ) ; } if ( this . formLogin != null ) { this . formLogin . authenticationManager ( this . authenticationManager ) ; if ( this . securityContextRepository != null ) { this . formLogin . securityContextRepository ( this . securityContextRepository ) ; } this . formLogin . configure ( this ) ; } if ( this . oauth2Login != null ) { this . oauth2Login . configure ( this ) ; } if ( this . resourceServer != null ) { this . resourceServer . configure ( this ) ; } if ( this . client != null ) { this . client . configure ( this ) ; } if ( this . anonymous != null ) { this . anonymous . configure ( this ) ; } this . loginPage . configure ( this ) ; if ( this . logout != null ) { this . logout . configure ( this ) ; } this . requestCache . configure ( this ) ; this . addFilterAt ( new SecurityContextServerWebExchangeWebFilter ( ) , SecurityWebFiltersOrder . SECURITY_CONTEXT_SERVER_WEB_EXCHANGE ) ; if ( this . authorizeExchange != null ) { ServerAuthenticationEntryPoint authenticationEntryPoint = getAuthenticationEntryPoint ( ) ; ExceptionTranslationWebFilter exceptionTranslationWebFilter = new ExceptionTranslationWebFilter ( ) ; if ( authenticationEntryPoint != null ) { exceptionTranslationWebFilter . setAuthenticationEntryPoint ( authenticationEntryPoint ) ; } ServerAccessDeniedHandler accessDeniedHandler = getAccessDeniedHandler ( ) ; if ( accessDeniedHandler != null ) { exceptionTranslationWebFilter . setAccessDeniedHandler ( accessDeniedHandler ) ; } this . addFilterAt ( exceptionTranslationWebFilter , SecurityWebFiltersOrder . EXCEPTION_TRANSLATION ) ; this . authorizeExchange . configure ( this ) ; } AnnotationAwareOrderComparator . sort ( this . webFilters ) ; List < WebFilter > sortedWebFilters = new ArrayList <> ( ) ; this . webFilters . forEach ( f -> { if ( f instanceof OrderedWebFilter ) { f = ( ( OrderedWebFilter ) f ) . webFilter ; } sortedWebFilters . add ( f ) ; } ) ; sortedWebFilters . add ( 0 , new ServerWebExchangeReactorContextWebFilter ( ) ) ; return new MatcherSecurityWebFilterChain ( getSecurityMatcher ( ) , sortedWebFilters ) ; }
Builds the {@link SecurityWebFilterChain}
@return the {@link SecurityWebFilterChain
Builds the {