I thought this is easy in xml configuration, but when I am now using java code configuration, I was lost, so can anyone tell me how I can config spring security to allow non-security check for static resource directory?
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests().antMatchers(actuatorEndpoints()).hasRole(backendAdminRole)
.and()
.authorizeRequests().antMatchers(apiEndpoints()).hasRole(frontendUserRole)
***//what code can I add here to make static directory/recourse not checked by spring security?***
.anyRequest().authenticated()
.and().anonymous().disable()
.exceptionHandling().authenticationEntryPoint(unauthorizedEntryPoint());
;
}
Thank you very much for your kind hlep first