Developer forum

Forum » Development » Login notification for impersonate users

Login notification for impersonate users

Rui Silva
Reply

Hi,

I’ve been implementing some features for solutions that use impersonation (with UserImpersonation.Full configuration) and I need to use the Notifications.Standard.User.OnExtranetLogin notification to make some actions for the secondary users login with success. The event is correctly fired for the second user, but the property SecondaryUserUserID is not filled with the id from the user that is impersonating the “new” primary user.

I’ve tracked this a little in the source code and found in the file Security.vb the method SaveSelectedSecondaryUser that has this lines:

Security.LogImpersonationStarted(user.Name, secondaryUser.Name)

ExtranetLogin(secondaryUser.Name, "", True, True, secondaryUser.ID, True)

secondaryUser.CurrentSecondaryUser = If(user.CurrentSecondaryUser, user)

user = secondaryUser

secondaryUser = secondaryUser.CurrentSecondaryUser

 

I think if you change the order of second and third lines on this peace of code the notification will have the property properly filled, making them look like this:

Security.LogImpersonationStarted(user.Name, secondaryUser.Name)

secondaryUser.CurrentSecondaryUser = If(user.CurrentSecondaryUser, user)

ExtranetLogin(secondaryUser.Name, "", True, True, secondaryUser.ID, True)

user = secondaryUser

secondaryUser = secondaryUser.CurrentSecondaryUser

 

My assumption could be wrong but it would most helpful to know in the notification if the user has a “secondary” user or not.

 

Thanks,

Rui Silva


Replies

 
Nicolai Pedersen
Reply

Hi Rui

We are looking into if this is a solution. It might affect what happens in the login procedure, so we just need to check that.

BR Nicolai

 
Rui Silva
Reply

Hi Nicolai,

Thanks for that. Hope you can manage to get the property filled even if you need to make other changes to the code.

Best,

Rui Silva

 
Vladimir
Reply
This post has been marked as an answer

Hi Rui

Task 30075 is registered - the fix will be appeared in nearest 8.9.1 release

 

Best regards,

Vladimir

Votes for this answer: 1
 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Rui

The problem TFS#30075 "Property SecondaryUserUserID is not filled in a login notification" has now been fixed in version 8.9.1.8

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 
Rui Silva
Reply

Hi I've notice that the line that created a session variable:
HttpContext.Current.Session("DW_extranet_SecondaryUserID") = secondaryUser.ID

is no longer in the code. Can you reinstate that, because we use that session variable in some data lists to get information on the secondary user.

thanks in advance,

Rui Silva

 

You must be logged in to post in the forum