File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/main/java/org/ohdsi/webapi Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,20 @@ public DataSourceAccessBeanPostProcessor dataSourceAccessBeanPostProcessor(DataS
119119 return new DataSourceAccessBeanPostProcessor (parameterResolver , proxyTargetClass );
120120 }
121121
122+ /**
123+ * Register the Shiro filter with the servlet container.
124+ * This is necessary for Spring Boot to properly apply the filter to all requests.
125+ */
126+ @ Bean
127+ public FilterRegistrationBean <AbstractShiroFilter > shiroFilterRegistration (ShiroFilterFactoryBean shiroFilterFactoryBean ) throws Exception {
128+ FilterRegistrationBean <AbstractShiroFilter > registration = new FilterRegistrationBean <>();
129+ registration .setFilter ((AbstractShiroFilter ) shiroFilterFactoryBean .getObject ());
130+ registration .addUrlPatterns ("/*" );
131+ registration .setName ("shiroFilter" );
132+ registration .setOrder (1 ); // Run before other filters
133+ return registration ;
134+ }
135+
122136 private Collection <Realm > getJwtAuthRealmForAuthorization (Security security ) {
123137
124138 return security .getRealms ().stream ()
You can’t perform that action at this time.
0 commit comments