2
我希望每個不在路徑/cobrands
和/fdt
之間的網址都可以申請密碼。如果我要求例如/fdt/name
我不應該被要求進行http認證。HttpSecurity有了Spring,區分網址的權限
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
/** code **/
@Override
protected void configure(HttpSecurity http) throws Exception {
http.exceptionHandling().authenticationEntryPoint(entryPoint()).and()
.authorizeUrls()
.antMatchers("/**").hasAnyAuthority("wf_cobrand_lettura", "wf_cobrand_fdt")
.antMatchers("/cobrands/*").permitAll()
.antMatchers("/fdt/*").permitAll()
.and()
.httpBasic();
}
}