I have an issue with one of my Okta filter that I used to have in web.xml. After Upgrading to Jira 10.3.1 from 9.117.4. I do not see any filter.
All I see in web.xml regarding filters is the following line:
When we try to add filters to the current web.xml file, this is the error we get:
All Jira Core servlet filters should be registered in com.atlassian.jira.web.filters.ServletFilters. Remove configuration for the following filters from web.xml:
[com.atlassian.jira.web.filters.SetupProgressFilter, com.atlassian.jira.web.filters.JiraImportProgressFilter, com.atlassian.jira.authenticator.okta.OktaLoginFilter, com.atlassian.jira.web.filters.StartupProgressFilter]
Did Anyone experience that issue?
We had Okta SSO properly working with the previous version of Jira but since we no longer have filters in web.xml. We are unable to direct users to the Okta SSO.
1 Like
Hello,
The same issue happened (updating from 9.12 to 10.3).
I did a quick diff between new and old web.xml
I added only lines concerning some specific features already updated on old web.xml
=> Jira has started.
Best Regards,
Did you ever get this resolved? Documentation says that we should no longer need the files, but just the internal SSO app. We’ve never been able to get the app to work, in Jira or Confluence.
Hi @AmroZein, @BrianErbe,
i had to migrate my filter to OSGI-Based-Filter because Jira10 does not longer use the web.xml for filter configuration. Instead Atlassian migrated to OSGI-based filter management.
This change is related to Atlassian’s goal to fully modularize and improve the stability of the Jira platform. Filters are now managed via OSGI Filter services directly rather than by editing web.xml.
As far as i know adding filter to web.xml or using jira-servlet-filter-plugin module will no longer work in Jira 10.x (Data Center).
They will be ignored and Jira will log a warning or ognore your setup.
Jira10.x does uses Java17 and the recommended way to register filters is via OSGI Declarative Services (DS).
What you could do:
Insert this dependency:
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component.annotations</artifactId>
<version>1.4.0</version>
<scope>provided</scope>
</dependency>
And create a Filter.class
import org.osgi.service.component.annotations.Component;
import javax.servlet.*;
import java.io.IOException;
@Component(
service = Filter.class,
property = {
"pattern=/secure/*", // Path where this filter applies
"order=10" // Optional order (lower = higher priority)
}
)
public class ExampleOSGiFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// Initialization if needed
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
// Custom filter logic
System.out.println("Example OSGi Filter Executed");
chain.doFilter(request, response);
}
@Override
public void destroy() {
// Cleanup if needed
}
}
Hope that helps.
Cheers,
Daniel