# Security exceptions

I'm trying to configure security exceptions to all JavaScript/CSS of my pages.

I need to login to access the JSP files, except the login page, but all pages needs your resources so the folders must be access-free.

.csrf().disable()
.authorizeRequests()
.antMatchers("/bower_components/**").permitAll()
.antMatchers("/custom/**").permitAll()
.antMatchers("/plugins/**").permitAll()
.antMatchers("/dist/**").permitAll()
.anyRequest().authenticated()
.and()


• Hi Jamal. The text has lost its meaning / purpose when you removed the the code seems ugly part of original question. I need to know if the code in question is as elegant as possible and without the original text the users may not know what I mean. Someone may flag as obscure... May 3, 2018 at 1:17