Developer forum

Forum » Templates » ExtranetLogOn method with an encrypted password

ExtranetLogOn method with an encrypted password

Ricardo Pereira
Ricardo Pereira
Reply

Hi All,

I'm trying to make an auto-login by the ExtranetLogOn method: https://doc.dynamicweb.com/api/html/ddfd9080-f65b-c03f-afd5-a0fe679e051d.htm
The problem is the passwords are encrypted and that method doesn't allow encrypted passwords. Does anyone have any good idea how can I make an auto-login with a username and a encrypted password?

Thank you!
 


Replies

 
Nicolai Pedersen
Reply

Hi Ricardo

Call Dynamicweb.Security.SystemTools.Crypto.Decrypt to get the password in clear text.

BR Nicolai

 
Nicolai Pedersen
Reply
This post has been marked as an answer

That works for passwords stored with a cookie in the browser.

If you take the password from user.password property (AccessUser.AccessUserPassword) it is hashed and cannot be decrypted nor can it be used for login.

The only option to logon a user without their password is with a passwordtoken. That is calculated by Dynamicweb Using Dynamicweb.Frontend.LoginHandler.GetLoginToken(password)

So find the user, create a token like this: token = Dynamicweb.Frontend.LoginHandler.GetLoginToken(User.Password) and make a redirect to

username={username}&pwtoken={token}

BR Nicolai

Votes for this answer: 1
 
Ricardo Pereira
Ricardo Pereira
Reply

Hi Nicolai,

Thank you for your quick answer. It was really helpful.

 

You must be logged in to post in the forum