How to perform API user logout to free user session?

Tin Wa Yeung January 10, 2012

Dear all,

I have a v1 plugin that updates issue; in order to do that, the API (getIssueService().update) requires the user to be logged in. Therefore, I used getJiraAuthenticationContext().setLoggedInUser(updateUser).

The problem is that after some time, the user sessions in JIRA are left over with a lot of "updateUser".

I cannot find an API to perform logout or session clearing.

Please help!! Thank you.

Best regards,

TimY

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Jeff Kirby
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.
January 10, 2012

have you tried ActionContext.getSession().invalidate()?

Tin Wa Yeung January 11, 2012

Thank you for the reply.

But how can I get the ActionContext??

Jeff Kirby
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.
January 11, 2012

ActionContext.getSession() is static like System.getCurrentTimeInMilliseconds(). It's always availiable in Jira

0 votes
Mikkel Kragelund Nielsen
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 21, 2012

Had the same problem: Using Atlassian Bot Killer to help maintain the amount of sessions.

This is a workaround, but I don't think they are planing to fix the problem.

0 votes
Mikkel Kragelund Nielsen
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.
February 21, 2012

Are you using the REST API?

If you are there is a bug. There should not be any session created:

https://jira.atlassian.com/browse/JRA-27047

0 votes
Mikkel Kragelund Nielsen
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.
February 21, 2012

Are you using the REST API?

If you are, there is a bug. There should not be any session created:

https://jira.atlassian.com/browse/JRA-27047

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events