2525import eu .webeid .example .security .AuthTokenDTOAuthenticationProvider ;
2626import eu .webeid .example .security .WebEidAjaxLoginProcessingFilter ;
2727import eu .webeid .example .security .ui .WebEidLoginPageGeneratingFilter ;
28+ import org .springframework .boot .autoconfigure .security .servlet .PathRequest ;
2829import org .springframework .context .annotation .Bean ;
2930import org .springframework .context .annotation .Configuration ;
3031import org .springframework .http .HttpMethod ;
@@ -51,12 +52,14 @@ public SecurityFilterChain filterChain(HttpSecurity http, AuthTokenDTOAuthentica
5152
5253 return http
5354 .authorizeHttpRequests (auth -> auth
55+ .requestMatchers (PathRequest .toStaticResources ().atCommonLocations ()).permitAll ()
5456 .requestMatchers ("/" , "/error" ).permitAll ()
5557 .requestMatchers (HttpMethod .GET , "/auth/eid/login" ).permitAll ()
5658 .requestMatchers ("/auth/challenge" ).permitAll ()
5759 .requestMatchers (HttpMethod .POST , "/auth/mobile/auth/init" ).permitAll ()
58- .requestMatchers ("/favicon.ico" , "/css/**" , "/files/**" , "/img/**" , "/js/**" ).permitAll ()
59- .anyRequest ().authenticated ()
60+ .requestMatchers ("/auth/login" ).permitAll ()
61+ .requestMatchers ("/welcome" ).hasRole ("USER" )
62+ .anyRequest ().permitAll ()
6063 )
6164 .authenticationProvider (authTokenDTOAuthenticationProvider )
6265 .addFilterBefore (new WebEidLoginPageGeneratingFilter (), UsernamePasswordAuthenticationFilter .class )
0 commit comments