CORS Filter to Spring Security

CORS Filter to Spring Security


When you enable spring security to your spring boot application, add cors filter otherwise everything would be blocked
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors()
            .and().authorizeRequests()
            .anyRequest().permitAll()
            .and().csrf().disable();
}

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days