I have a Spring Boot based application. I want the URL /camunda/app/welcome/default/#!/login to be accessible without any authentication, while the URLs
/camunda/app/welcome/default/#!/welcome,/camunda/app/welcome/default/#!/dashboard,/camunda/app/tasklist/**, and/camunda/app/admin/**
must be secured (i. e. only authenticated users should be able to access them).
To achieve this, I wrote the following configuration:
@Configuration @EnableWebSecurity public class MyConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .requestMatchers() .and() .authorizeRequests() .antMatchers("/camunda/app/welcome/default/#!/login").permitAll() .antMatchers("/camunda/app/welcome/default/#!/welcome", "/camunda/app/welcome/default/#!/dashboard", "/camunda/app/tasklist/**", "/camunda/app/admin/**", "/oauth2/authorization/**", "/oauth2/code/myredirecturl") .authenticated() .and() .oauth2Login(...) .logout() .logoutRequestMatcher(...) .logoutSuccessHandler(...); } } However with this configuration unauthenticated users can access URLs that are supposed to be protected (/camunda/app/welcome/default/#!/welcome, /camunda/app/welcome/default/#!/dashboard, /camunda/app/tasklist/**, /camunda/app/admin/**).
What is wrong with my configuration and how can I fix it?