2424import eu .openanalytics .containerproxy .auth .IAuthenticationBackend ;
2525import eu .openanalytics .containerproxy .auth .UserLogoutHandler ;
2626import eu .openanalytics .containerproxy .auth .impl .OpenIDAuthenticationBackend ;
27+ import eu .openanalytics .containerproxy .service .IdentifierService ;
2728import eu .openanalytics .containerproxy .util .AppRecoveryFilter ;
2829import eu .openanalytics .containerproxy .util .EnvironmentUtils ;
2930import eu .openanalytics .containerproxy .util .OverridingHeaderWriter ;
@@ -93,6 +94,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
9394
9495 @ Inject
9596 private AppRecoveryFilter appRecoveryFilter ;
97+
98+ @ Inject
99+ private IdentifierService identifierService ;
96100
97101 @ Autowired (required =false )
98102 private List <ICustomSecurityConfig > customConfigs ;
@@ -108,13 +112,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
108112
109113 @ Override
110114 public void configure (WebSecurity web ) {
111- // web
112- // .ignoring().antMatchers("/css/**").and()
113- // .ignoring().antMatchers("/img/**").and()
114- // .ignoring().antMatchers("/js/**").and()
115- // .ignoring().antMatchers("/assets/**").and()
116- // .ignoring().antMatchers("/webjars/**").and();
117- //
118115 if (customConfigs != null ) {
119116 for (ICustomSecurityConfig cfg : customConfigs ) {
120117 try {
@@ -225,7 +222,13 @@ public void handle(HttpServletRequest request, HttpServletResponse response, Acc
225222 if (auth .hasAuthorization ()) {
226223 http .authorizeRequests ().antMatchers (
227224 "/login" , "/signin/**" , "/auth-error" , "/error" , "/app-access-denied" , "/logout-success" ,
228- "/favicon.ico" , "/css/**" , "/img/**" , "/js/**" , "/assets/**" , "/webjars/**" ).permitAll ();
225+ "/favicon.ico" ,
226+ "/" + identifierService .instanceId + "/css/**" , "/css/**" ,
227+ "/" + identifierService .instanceId + "/img/**" , "/img/**" ,
228+ "/" + identifierService .instanceId + "/js/**" , "/js/**" ,
229+ "/" + identifierService .instanceId + "/assets/**" , "/assets/**" ,
230+ "/" + identifierService .instanceId + "/webjars/**" , "/webjars/**"
231+ ).permitAll ();
229232 http
230233 .formLogin ()
231234 .loginPage ("/login" )
0 commit comments