Developer forum

Forum » Development » Extranet login

Extranet login


Reply

In my AccessUser table I have two users, with the same username and password. The two users contain almost the same data, but have access to different areas. The reason why they are separate into two posts in the table, is that they come from two different ERP systems and the user data is integrated from these.

 

Now I need a way to overrule the Extranet login, so that I can login the right user, depending on the current area.
 


Replies

 
Reply

Remember the last Tech Review session where I talked about the new Extranet notifications Dynamicweb.Notifications.Standard.User.OnExtranetLogin and Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed. You need the first one, and once you know, which user is logged on, log him of using Session.Abandon and log ham in using the techniques described here: http://developer.dynamicweb.dk/default.aspx?id=16918&action=ShowArticle&ArticleID=141

 
Reply
Sorensen wrote:

Remember the last Tech Review session where I talked about the new Extranet notifications Dynamicweb.Notifications.Standard.User.OnExtranetLogin and Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed. You need the first one, and once you know, which user is logged on, log him of using Session.Abandon and log ham in using the techniques described here: http://developer.dynamicweb.dk/default.aspx?id=16918&action=ShowArticle&ArticleID=141


 

The described technique will not work. The only two parameters the ExtranetLogin method accept is username and password. So the system will login the same user again (The user with the lowest AccessUserID).

 
Reply

Oh, both are the same? Nasty...

 

Well, once you're logged in, you just need to change the session values that vary, so do that in the OnExtranetLogin notification.

 

Have a look at the Session collection when you're logged on extrane. Look for the values prefixed with DW_Extranet_. Change the ones you need in order to specify the user.

 

Please keep in mind that Dynamicweb doesn't support multiple records with the same AccessUserUserName, and you're very likely to experience unintended behavior in this case.

 

You must be logged in to post in the forum