Jira not logged in User pass filter is jump to login page.What should I do?
Hello,
You can find an answer here:
https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-make-a-Servlet-plugin-module-accessible-only-after-login/qaq-p/548510
Thanks。but my code is
atlassian-plugin.xml
<servlet-filter name="permitServlet" key="dsdFilter" class="web.filter.lmFilter" system="true" weight="100"> <description>this is the first filter </description> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher></servlet-filter>
@Overridepublic void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest request=(HttpServletRequest)req; HttpServletResponse response=(HttpServletResponse) resp; ApplicationUser loggedInUser = jiraAuthenticationContext.getLoggedInUser(); if (null == loggedInUser) { String url = request.getContextPath()+"/login.jsp?permissionViolation=true&os_destination="+request.getRequestURI(); StringBuffer stringBuffer = new StringBuffer(); String fullUrl =(stringBuffer.append(url).append("?").append(request.getQueryString())).toString(); response.sendRedirect(fullUrl);}
I don't know where the mistake is.
Thanks again. (-_-)
It looks like you're new here. Sign in or register to get started.