1

I am developing a single page app (vaadin 11 + CAS + Spring)

These urls are secured:

.regexMatchers("/secured.*").authenticated()

To log in I enter "localhost:8080/secured"

I want to redirect the "/" url so that if I call "localhost:8080" it redirects to "/secured"

To do so I add:

@GetMapping("/")
public String index() {
  return "redirect:secured";
}

But now, when I call localhost:8080 I get 405 errors every 5 secondes:

Request URL: http://localhost:8080/?v-r=uidl&v-uiId=0
Request Method: POST
Status Code: 405 

I think this comes from vaadin engine...

How can I make this work ?

security conf:

@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf()
    .disable()
    .authorizeRequests()
    .regexMatchers("/secured.*")
    .authenticated()
    .and()
    .authorizeRequests()
    .regexMatchers("/")
    .permitAll()
    .and()
    .httpBasic()
    .authenticationEntryPoint(authenticationEntryPoint)
    .and()
    .addFilterBefore(singleSignOutFilter, CasAuthenticationFilter.class)
    .addFilterBefore(logoutFilter, LogoutFilter.class);

}
Tyvain
  • 2,640
  • 6
  • 36
  • 70
  • I think the answer I gave to your other question addresses this as well: https://stackoverflow.com/questions/52303909/vaadin-10-button-redicted-to-url/52307333#52307333 – Tatu Lund Sep 14 '18 at 10:30
  • not exactly. In this case, I just want to be able to access my application with 'myapp.com' instead of 'myapp.com/secured'. I think the 405 are triggerd by the way vaadin works. – Tyvain Sep 16 '18 at 20:11
  • Have you tried to set @Route("secured") to your main view together with @RouteAlias("")? – Tatu Lund Sep 17 '18 at 05:33

0 Answers0