Rate this page:
This page describes how to access the logged in user when writing a Confluence app.
For Confluence versions prior to 5.2, the user can be retrieved from the
com.atlassian.confluence.user.AuthenticatedUserThreadLocal
class, which will give you the current
logged in user as a com.atlassian.confluence.user.ConfluenceUser
object.
1
ConfluenceUser confluenceUser = AuthenticatedUserThreadLocal.get();
Note that if there is no logged in user, then the user object returned will be null
.
AuthenticatedUserThreadLocal
was deprecated in Confluence 5.2. For newer versions use
com.atlassian.confluence.user.AuthenticatedUserAccessor
.
1
Optional<ConfluenceUser> confluenceUser = AuthenticatedUserAccessor.get();
Which returns the currently authenticated com.atlassian.confluence.user.ConfluenceUser
, if any.
Rate this page: