public void configure(WebSecurity web) throws Exception { web .ignoring() .antMatchers("/resources/**"); }
@Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers("/static/public/**"); }
@Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers("/api/v1/signup"); }
@Override public void configure(WebSecurity web) { String ignoreURLs = env.getProperty("nacos.security.ignore.urls", "/**"); for (String ignoreURL : ignoreURLs.trim().split(SECURITY_IGNORE_URLS_SPILT_CHAR)) { web.ignoring().antMatchers(ignoreURL.trim()); } }
@Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers("/resources/static/**"); }
@Override public void configure(WebSecurity webSecurity) throws Exception { // ignore the access endpoints for obtaining the access config, the access token // granting, and access status for a given user (note: we are not ignoring the // the /access/download-token and /access/ui-extension-token endpoints webSecurity .ignoring() .antMatchers("/access", "/access/config", "/access/token", "/access/kerberos", "/access/oidc/**", "/access/knox/**"); }
web.ignoring().antMatchers("/css/**", "/js/**", "/img/**", "/lib/**");
@Override public void configure(WebSecurity web) throws Exception { web .ignoring() .antMatchers("/resources/**"); }
@Override public void configure(WebSecurity web) throws Exception { web .ignoring() .antMatchers("/resources/**", "/public/**"); }
@Override public void configure(WebSecurity web) throws Exception { // @formatter:off web .ignoring() .mvcMatchers("/path"); // @formatter:on }
@Override public void configure(WebSecurity web) throws Exception { // AuthenticationTokenFilter will ignore the below paths web .ignoring() .antMatchers( HttpMethod.POST, authenticationPath ) // allow anonymous resource requests .and() .ignoring() .antMatchers( HttpMethod.GET, "/", "/*.html", "/favicon.ico", "/**/*.html", "/**/*.css", "/**/*.js" ) // Un-secure H2 Database (for testing purposes, H2 console shouldn't be unprotected in production) .and() .ignoring() .antMatchers("/h2-console/**/**"); } }
@Override public void configure(WebSecurity web) throws Exception { web .ignoring() .antMatchers("/ignore1", "/ignore2"); }
@Override public void configure(WebSecurity web) throws Exception { web .ignoring() .antMatchers("/resources/**"); }
@Override public void configure(WebSecurity web) throws Exception { // @formatter:off web .ignoring() .mvcMatchers("/path").servletPath("/spring") .mvcMatchers("/notused"); // @formatter:on }
@Configuration @EnableWebSecurity public class MyWebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers("/resources/**"); } @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/").permitAll() .antMatchers("/dashboard/home/**").hasAnyRole("USER", "ADMIN") .antMatchers("/dashboard/users/**").hasRole("ADMIN") .antMatchers("/rest/users/**").hasRole("ADMIN") .anyRequest().authenticated() .and() .formLogin() .loginPage("/") .permitAll(); } // Possibly more overridden methods ... }
/** * 在此配置不过滤的请求 */ @Override public void configure(WebSecurity web) throws Exception { //每一个请求对应一个空的filter链,这里一般不要配置过多, // 因为查找处是一个for循环,过多就导致每个请求都需要循环一遍直到找到 web.ignoring().antMatchers("/","/login","/favicon.ico"); }
.ignoring() .antMatchers("/static/**","/status");
@Override public void configure(WebSecurity web) throws Exception { //忽略权限校验的访问路径 web .ignoring() .antMatchers( "/hello", "/favicon.ico", "/swagger**/**", "/*/api-docs", "/webjars/**", "/*/sms/captcha", "/*/user/password", "/*/currency/**" ) .antMatchers(HttpMethod.POST, "/*/user") ; }