Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » ExtranetLogin
Peter Gustafsson
Reply

Hi guys,
security.ExtranetLogin method seems to be removed in version 9.3.5. What is the replacement method?
We are trying to upgrade a client solution where it is used in the context below: 

// Workaround for programmatic logins with hashed passwords setting in DW, read more on https://doc.dynamicweb.com/forum/development/development/authenticate-user-through-api
                var originalPasswordStringFromDatabase = loginUser.Password;
                loginUser.Password = "TempPassword";
                loginUser.Save();

                security.ExtranetLogin(loginUser.UserName, "TempPassword", true);

                loginUser.Password = originalPasswordStringFromDatabase;
                loginUser.Save();


Replies

 
Martin Vang
Martin Vang
Reply

Hi Peter,

Try Frontend.LoginHandler's ExtranetLogOn method. We're done some cleanup of naming for "log on" (action that authenticates the user) and "login" (user id), so things might have been moved arround a bit.

Let me know how this works out.

BR

Martin

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

LoginHandler is now obsolete as well. What's the new alternative?

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

It seems to have gone here:

new LogOnHandler().LogOn(userName, password);

 
Peter Leleulya
Reply

Can the password be the encrypted version?
I can't seem to get logged on ... and of course I do not have plain passwords to use ...

 
Nicolai Pedersen
Reply

Hi Peter

You cannot logon a user with that method without the password.

You can use a token may:

loginToken = LogOnHandler.GetLoginToken(username, encryptedPassword)
LogOnHandler.ExtranetLoginToken(username, loginToken) 'This is not public!!

But you can use a querystring:

?Username={username}&pwtoken={token}

I just updated the API so that you get a method to call: LogOnHandler.LogOnWithToken

BR Nicolai

 
Peter Leleulya
Reply

Hi Nicolai, thnx for your quick response.
I updates all my nupkegs (took me a while) but the method LogOnWithToken did not appear.
What can I do?
 

 
Nicolai Pedersen
Reply

Well, I just made the commit, so it will not be released until QA verifies and release it. Next version of the Dynamicweb package will have the feature. TFS#52147

 
Peter Leleulya
Reply

Thanks Nicolai.
Will the LogOnWithToken method take the user active state in consideration?
The normal logon has an activeOnly boolean which in my case I want to be true.

 

You must be logged in to post in the forum