cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to find current logged in HMC and Backoffice user details?

Former Member

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hybris OTB provides the CockpitUserService which can return the current user. Please try to use the same.

thanks,

former_member1320010
Participant
0 Kudos

i guess they have something like this ( also not sure which version you are using...)

backoffice-widget.xml

 <widget id="backofficeUserroleChooser" widgetDefinitionId="com.hybris.backoffice.userRoleChooser" slotId="indicators" template="false">
                 <setting key="widgetStyleAttribute" type="String"></setting>
                 <setting key="widgetStyleClass" type="String"></setting>
                 <virtual-sockets/>
             </widget>
Former Member
0 Kudos

How to use this exactly code wise to get the details of the user who has logged into hmc/backoffice?

former_member1320010
Participant
0 Kudos

The widget comes with Backoffice and should be already working for you without any customization on the right top corner

If you want to know more abt the code you can check below class.

Eg : - UserRoleChooserWidgetController -> String userId = this.cockpitUserService.getCurrentUser();