How to map security constraint to defult page ? e.g. I'm using Keycloak and i want my app to redirect to Keycloak's login page whenever user tries to achieve my app: localhost:8080/ <- this must redirect to Keycloak's login page.
I tried the following patterns:
1. super.configure(http);
http
.csrf()
.disable()
.authorizeRequests()
.antMatchers("/*").hasRole("ADMIN");
2.super.configure(http);
http
.csrf()
.disable()
.authorizeRequests()
.antMatchers("/").hasRole("ADMIN");
3.super.configure(http);
http
.csrf()
.disable()
.authorizeRequests()
.antMatchers("/**").hasRole("ADMIN");
4.super.configure(http);
http
.csrf()
.disable()
.authorizeRequests()
.anyRequest().hasRole("ADMIN");
5.super.configure(http);
http
.csrf()
.disable()
.authorizeRequests()
.antMatchers("*").hasRole("ADMIN");
But none of them works...
Btw when i type sub-urls e.g. localhost:8080/users, everything works fine and Keycloak's login page occurs.