0

I will appreciate if someone help in this matter, I am trying to run a simple Spring boot application using JSF & Primefaces.

Everything is working fine without using Spring Boot Security, but when enable it in pom.xml and create a WebSecurityConfig class and Override the following method:

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests().antMatchers("/resources/**","/index.xhtml")
   .permitAll()
    .anyRequest().authenticated()
    .and()
    .formLogin().loginPage("/login.xhtml")
     .permitAll()
    .and().logout().permitAll();
}

Then the Primefaces component are not rerendring. when comment this method or make .anyRequest().primitAll() then it's working fine.

Anyone has an idea how to solve this?

Sami Raed
  • 9
  • 1
  • its `"/javax.faces.resource/**"` not `/resources/**` – Ouerghi Yassine Dec 25 '16 at 21:12
  • I have added the new path, but it's not working too. I will give an example here, if I use p: any component, then enable Spring boot Security this component won't be set. if I remove spring security then all Prmefaces components are working fine. – Sami Raed Dec 26 '16 at 08:46

1 Answers1

0

I have fixed the issue by do the following:

1- Remove .anyRequest().authenticated()

2- Specify the access for pathes as following:

.antMatchers("/resources/**","/index.xhtml","/dashboard.xhtml").permitAll()
.antMatchers("/panel.xhtml").authenticated()
Sami Raed
  • 9
  • 1