Get Current Logged user and make it log-in into REST CLIENT

Hello,

I’m working into a JIRA plugin with the library “JIRA REST CLIENT FOR JAVA” and I was wondering how can I get the current logged user in the application so that I can get the credentials in order to use the rest api with every user instead of asking for the username and password everytime I want to use it.

I’ve been reading and there’s a function to get the current logged user in the app but I have no idea on how to use this “ApplicationUser” in order to get the API authentication.

Thanks in advance.

1 Like

Hi,

This method returns the user currently logged (ApplicationUser)
ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

Look here
https://docs.atlassian.com/software/jira/docs/api/7.0.6/com/atlassian/jira/security/JiraAuthenticationContext.html