Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jira plugin servlet redirect

Vincent_Browning
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2018

Jira not logged in User pass filter is jump to login page.What should I do?

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 19, 2018
Vincent_Browning
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2018

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&amp;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. (-_-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events