Developer forum

Forum » Development » DW API Impersonation

DW API Impersonation

Mikkel Belchuke
Mikkel Belchuke
Reply

Hi.

We've developed an app and the customer would like to impersonate users, like they can on their DW shop. 

Is this possible through the Web API?


Replies

 
Mikkel Hammer
Mikkel Hammer
Reply

+1

 
Anders Ebdrup
Anders Ebdrup
Reply

+1

 
Tor Leeberg
Reply

+1

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

+1

 
Mikkel Belchuke
Mikkel Belchuke
Reply

Hi DW. Are there any news regarding this question?

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Yes - it is in progress.

You get an endpoint to get a list of users that a given user can impersonate (/impersonatees) using the current logged in JWT token.

From that list you get a list of users - you can then call /impersonate with a userid that will impersonate (if your current JWT token allows impersonation of that userid) - it does the same as /authenticate. Then you basically have 2 JWT tokens that you can switch between when calling the webapi.

Do you need an overload of /impersonate to take i.e. a username or an email together with a shopid as another ?

BR Nicolai

Votes for this answer: 1
 
Mikkel Belchuke
Mikkel Belchuke
Reply

Hi Nicolai.

That sounds great. Just what we need!

I can't think of a scenario where we need an overload of such. The /impersonate endpoint should do the trick. 

Looking forward to see this in action. 

 
Mikkel Belchuke
Mikkel Belchuke
Reply

Hi Nicolai.

Are there any news on this feature? 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Added and merged on the 22/9...

Votes for this answer: 1
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Arhg - it is not merged into production branch!

I have asked to get it merged right away.

Looks like this:

Votes for this answer: 3
 
Mikkel Belchuke
Mikkel Belchuke
Reply

That's perfect Nicolai!

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen

 

You must be logged in to post in the forum