on 2022 Oct 19 5:52 AM
Hi,
I am trying to get the current customer for whom the ASM agent has started the session, tried below few OOTB services but nothing worked.
userService.getCurrentUser();
assistedServiceService.getAsmSession().getEmulatedCustomer()
I am using Spartacus ASM with Hybris 2011.
Thanks,
Request clarification before answering.
Hi samsharma007
during an ASM session, the Out of The Box path param userId refers to the impersonated user while "current" is the agent user.
/users/{userId}/
You have to ensure that the proper userId is provided to backend calls. If it's missing in the calls, then you have to apply some changes to Spartacus. Not all OCC Controllers have the path param in the @RequestMapping, in those cases you have to extend the backend APIs as well.
If you like the answer please accept it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did you try the assistedServiceFacade class like below?
assistedServiceFacade.getAsmSession().getEmulatedCustomer().getUid()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, could you look into this document for spartacus => https://sap.github.io/spartacus-docs/asm/
User | Count |
---|---|
22 | |
18 | |
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.