List of usage examples for org.springframework.security.config.annotation.web.builders HttpSecurity antMatcher
public HttpSecurity antMatcher(String antPattern)
From source file:com.netflix.genie.web.security.saml.SAMLConfig.java
/** * Defines the web based security configuration. * * @param http It allows configuring web based security for specific http requests. * @throws Exception on any error/* w ww . j a v a2 s . co m*/ */ @Override protected void configure(final HttpSecurity http) throws Exception { // @formatter:off http.httpBasic().authenticationEntryPoint(samlEntryPoint()); http.csrf().disable(); http.addFilterBefore(metadataGeneratorFilter(), ChannelProcessingFilter.class).addFilterAfter(samlFilter(), BasicAuthenticationFilter.class); http.antMatcher("/**").authorizeRequests().antMatchers("/actuator/**").permitAll().antMatchers("/api/**") .permitAll().antMatchers("/error").permitAll().antMatchers("/saml/**").permitAll().anyRequest() .authenticated().and().x509().authenticationUserDetailsService(this.x509UserDetailsService); http.logout().logoutSuccessUrl("/"); // @formatter:on }
From source file:com.netflix.genie.security.saml.SAMLConfig.java
/** * Defines the web based security configuration. * * @param http It allows configuring web based security for specific http requests. * @throws Exception on any error/*from ww w.j av a 2 s . c o m*/ */ @Override protected void configure(final HttpSecurity http) throws Exception { // @formatter:off http.httpBasic().authenticationEntryPoint(samlEntryPoint()); http.csrf().disable(); http.addFilterBefore(metadataGeneratorFilter(), ChannelProcessingFilter.class).addFilterAfter(samlFilter(), BasicAuthenticationFilter.class); http.antMatcher("/**").authorizeRequests().requestMatchers(EndpointRequest.toAnyEndpoint()).permitAll() .antMatchers("/api/**").permitAll().antMatchers("/error").permitAll().antMatchers("/saml/**") .permitAll().anyRequest().authenticated().and().x509() .authenticationUserDetailsService(this.x509UserDetailsService); http.logout().logoutSuccessUrl("/"); // @formatter:on }