Skip to Content
author's profile photo Former Member
Former Member

How to initiate a proxy session for another user by an already logged in user?

Hi ,

I am looking for a solution to impersonate a user i.e. A logged in user can switch to another user , which also include switching the user Groups. for example A logged in ProductManager can initiate a proxy session for another user CatalogManager (which has different user groups associated).

I would appreciate a quick response .

Thanks,

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 19, 2015 at 02:47 PM

    Take a look at the ImpersonationService api's, they have existed since the early 4.x versions: https://download.hybris.com/api/5.5.0/commercesuite/de/hybris/platform/commerceservices/impersonation/impl/DefaultImpersonationService.html

    Also look at the Assisted Service Module (ASM) - https://wiki.hybris.com/display/release5/Assisted+Service+Module

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Nb. Take a look at hybris/bin/ext-template/yb2bacceleratortest/src/de/hybris/platform/yb2bacceleratortest/services/AccountManagerApproveScheduleService.java as an example of how to make use of this. There's unfortunately no examples I'm aware of on the wiki to help with using this invaluable service.

  • author's profile photo Former Member
    Former Member
    Posted on May 19, 2015 at 01:15 PM
    -1

    Hey,

    I got the answer for the above queries, spring security come with a Filter "SwitchUserFilter" , which has two methods.

     protected Authentication attemptSwitchUser(final HttpServletRequest request){
     //TBD
     }
    
     protected Authentication attemptExitUser(final HttpServletRequest request) {
     //TBD
     }
    
    

    Which can be leveraged to impersonate the a proxy user.

    Thanks,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.