Developer forum

Forum » CMS - Standard features » Impersonation via API

Impersonation via API

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

My customers are divided into different usergroups, with the customers name as the group name.
Under each group I have created an administrator-user with the same name as the group and with the email address as the username. The password is empty.

Other ordinary users are added to the group, each with a unique username and password. Each of them has added the administrator-user as a user they can impersonate.

What I would like to achieve, is that whenever an ordinary user is logged in, they are automatically impersonating the administrator-user, with the admin-users addresses and favoritelists.

I've looked into the Impersonate method in Dynamicweb.Security.Impersonation, but it requires a username and password, in order to impersonate. My admin-user does not have a password (but I could create on for him).

What would be the best way of doing this?

--
Best regards
Kurt Moskjaer Andersen


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Dynamicweb.Security.Impersonation covers windows impersonation in relation to management in web & http in Settings. So not related to frontend impersonation at all...

When logging in, you can loop a list of users that can be impersonated - in your case just one. Use the UserID from that user to call the URL with DWExtranetSecondaryUserSelector={ImpersonateUserID} - you can do that with js when the page loads.

BR Nicolai

Votes for this answer: 1
 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Can I use this impersonation with the CustomerCenter in Ecom, to show the impersonated persons addresses and favoritelists?

/Kurt

 
Nicolai Pedersen
Reply

Yes - if you set impersonation type to "Full"

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Well, I did :) I have to dig a bit deeper then :)

Thanks.

/Kurt

 
Nicolai Pedersen
Reply

Just to clarify:

User 1
User 2
User 3

can all impersonate "Administrator"

When the administrator is impersonated by any of the users 1-3, the customer center will show addresses from administrator and not the user.

BR Nicolai

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Exactly! :)

 

You must be logged in to post in the forum