How to get the current logged in user in my kibana plugin server side

Hi,
I am writing a kibana plugin and I would like to get the current logged in user infos such as username from my plugin server.
I have tried server.plugins.security.getuser but nothing.
Any idea?
thanks

Hi @sudosu,

  1. What version of Kibana are you using?
  2. What type of plugin are you writing (legacy or new/current)?
  3. Is security plugin enabled?

Best,
Oleg

  1. the version is 7.4.2
  2. I guess it's legacy. What's the difference ?
  3. No it's not.
    I just used the open source kibana version like recommended on the github page.
    thanks.