Bitbucket Server plugin: how to get the current logged user?

Deleted user April 13, 2017

Hi.

 

Within the Java code of a Bitbucket Server plugin, I would like to get the user who is currently logged in to Bitbucket.

 

In another post related to Jira, I found this line:

User user = ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser();

However this is for Jira, also it was 2013. There is apparently no such thing as ComponentAccessor in the Bitbucket libraries. Is there any similar way to achieve this in Bitbucket?

1 answer

2 votes
PG April 13, 2017

You can use getCurrentUser method in com.atlassian.bitbucket.auth.AuthenticationContext

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events