Developer forum

Forum » CMS - Standard features » External login provider and impersonation issue

External login provider and impersonation issue

Thomas Larsen
Reply

When using an external login provider and after that impersonates another user the following cookie is added

Name: DW_ExtranetSessionCookie
Value: DWExternalLoginProviderId=1&AL=&DWExtranetImpersonateUserID=xwqtolpvMW8=

If the user don’t stop impersonation or signs out the following exception is thrown after session timeout.

[NullReferenceException: Object reference not set to an instance of an object.]
   Dynamicweb.Frontend.LogOnHandler.LogFailedFrontendLogin(String username) +19
   Dynamicweb.Frontend.LogOnHandler.LogOn(String username, String password, Boolean onlyActive, Boolean impersonateUser, Int32 impersonateUserId, Boolean skipPasswordCheck) +7952
   Dynamicweb.Frontend.LogOnHandler.CookieLogon() +323
   Dynamicweb.Frontend.SecurityHandler.ExtranetStart() +1560
   Dynamicweb.Frontend.LoginHandler.ExtranetStart(Int32 pageId) +46
   Dynamicweb.Frontend.PageView.Load() +2359
   Dynamicweb.Frontend.DynamicwebHttpHandler.ProcessRequest(HttpContext context) +176


Running on DW 9.9.1

BR
Thomas


Replies

 
Alexey Tanchenko Dynamicweb Employee
Alexey Tanchenko
Reply

Hello Thomas.

I have tried to investigate described issue on several DW versions, but do not faced any exceptions. 

There is a point that confuses me a bit - your cookie have this value - DWExternalLoginProviderId=1.
In DW 9.9.0 or even in latest hotfixes of DW 9.8 we had a related change. After the change, this value should alwas be cleaned out right after you redirected from external login website back to you DW website - DWExternalLoginProviderId=.
I guess it could be a reason why you get the exception, but I have to reproduce the issue at first to know if something needs a fix.

Probably you could provide some more details?

 
Nicolai Pedersen
Reply

Hi Thomas

We got it reproduced now. We will bug it and fix it.

Thanks, Nicolai

 
Thomas Larsen
Reply

Hi Nicolai,

Great :-)

In a 9.9 hotfix?

/Thomas

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Thomas

The bugfix has been released in Dynamicweb version 9.10.7

You are able to download this from release section: https://doc.dynamicweb.com/downloads/releases

Please contact support@dynamicweb.dk if you need any help regarding the upgrade

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 
Thomas Larsen
Reply

Hi Kristian,

We can't upgrade the solution to DW 9.10 right now.

Is it possible to get a DW 9.9 hotfix?

BR
Thomas
 

 
Nicolai Pedersen
Reply

Hi Thomas

Of course we can. I have asked for a 9.9 merge...

BR Nicolai

 
Alexey Tanchenko Dynamicweb Employee
Alexey Tanchenko
Reply

Hi Thomas,

The fix is released in Dynamicweb 9.9.24

BR Alexey

 
Thomas Larsen
Reply

Hi Alexey,

Where do i find that release?

BR
Thomas

 
Nicolai Pedersen
Reply

Hi Thomas

You can find it on Nuget: https://www.nuget.org/packages/Dynamicweb/9.9.24​

BR Nicolai

 
Thomas Larsen
Reply

Thanks, 

After upgrading to version 9.9.24 we don't get the exception anymore on pageload anymore when the session is timed out

But the external login provider is not working until the DWExtranetImpersonateUserID information is removed from the DW_ExtranetSessionCookie?

BR
Thomas

 
Thomas Larsen
Reply

Anyone?

BR
Thomas

 
Alexey Tanchenko Dynamicweb Employee
Alexey Tanchenko
Reply

Hi Thomas,

I will investigate the issue. Could you please provide more details?

 

BR, Alexey

 
Alexey Tanchenko Dynamicweb Employee
Alexey Tanchenko
Reply

Hi Thomas,
I have tested several scenarios which I could come up with. But do not get any issues. Can you please specify any additional details: steps, logs, error text, etc.

 

BR, Alexey

 

You must be logged in to post in the forum