Ola Pessoal, tudo bem?
Estou enfrentando um problema de acesso na minha aplicação:
- Tenho um Controller com a seguintes características:
//imports e etc...
@Controller
@Transactional
@RequestMapping("/cliente")
public class EmpresaController {
//Outros métodos...
@RequestMapping(method=RequestMethod.POST, value="/exibirEmpresa/{idEmpresa}", name="carregarEmpresa")
public ModelAndView exibirEmpresa(@PathVariable(value="idEmpresa") String idEmpresa){
}
- E o seguinte SecurityConfiguration:
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/").permitAll()
.antMatchers("/login").permitAll()
.antMatchers("/logar").permitAll()
.antMatchers("/updatePassword").permitAll()
.antMatchers("/solicitarNovaSenha").permitAll()
.antMatchers("/esqueciSenha").permitAll()
.antMatchers("/solicitarSenha").permitAll()
.antMatchers("/selecionarModulo/**").hasRole("ADMIN")
.antMatchers("/gerencial/**").hasRole("ADMIN")
.antMatchers("/cliente/**").access("hasRole('ADMIN') and hasRole('CLIENTE')")
.anyRequest().authenticated()
.and()
.formLogin().loginPage("/login").permitAll().defaultSuccessUrl("/inicial/validarLogin").failureUrl("/loginInvalido")
.and()
.logout().invalidateHttpSession(true).clearAuthentication(true)
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"));
}
}
Mas quando um usuário com a role CLIENTE tenta, através de um POST num form, acessar url abaixo:
'/minhaaplicacao/cliente/exibirEmpresa/1'
O sistema retorna a seguinte mensagem no navegador:

HTTP Status 403 - Access is denied
type Status report
message Access is denied
description Access to the specified resource has been forbidden.
Apache Tomcat/8.5.11
Desde já fico muito grato com qualquer colaboração e me coloco a disposição para qualquer esclarecimento.
Abraços,
Wagner dos Santos Brito.