Developer forum

Forum » Development » Impersonate by api

Impersonate by api

Anders Ebdrup
Anders Ebdrup
Reply

Hello,

 

We are working on an app which are using the api of Dynamicweb and this app needs to use the impersonation logic. But how can we set the secondary user by the api?

Can this method be used if it is not a "friend":

        Friend Sub LogOn(username As String, password As String, onlyActive As Boolean, impersonateUser As Boolean, impersonateUserId As Integer, loginIfPasswordEncrypted As Boolean)


Or does is use the context which is not available in our json request?

 

Best regards, Anders


Replies

 
Nicolai Pedersen
Reply

Hi Anders

You can use that method to impersonate - but it has a lot of context, but not querystring/form context. But session etc...

You can look into SecuirtyHandler.SaveSelectedSecondaryUser to see how it is used to impersonate - it also requires some context of the user being logged in.

BR Nicollai

 

You must be logged in to post in the forum