Jira not logged in User pass filter is jump to login page.What should I do?
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>
@Override
public 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. (-_-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.