How to make a Servlet plugin module accessible only after login?

This question is in reference to Atlassian Developer Documentation: Servlet Plugin Module

It seems that Servlet plugin makes the servlet accessible even without login to Jira. This could be noted in this article and also a hint how to make it accesible only after login would be good, thanks.

1 answer

1 accepted

Thank you! The code in doGet looks like:

if (!ComponentAccessor.getJiraAuthenticationContext().isLoggedInUser()) {

Actually, now I wonder how to do it in a way that when a user is not logged in, a login is requested and then the target page is shown...? Thanks!

You can redirect to login. Quick search through JIRA sources gave me this:

private String redirectToLogin()
        HttpServletRequest request = getHttpRequest();
        String returnURL = getCurrentURL();
        if (request.getQueryString() != null)
            returnURL += "?" + request.getQueryString();
        return getRedirect("/login.jsp?os_destination=" + JiraUrlCodec.encode(returnURL), false);

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: More details: https://co...

44 views 1 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you