![]() The PasswordBox uses encrypted memory (of sorts) and the only way to access the password is through the CLR property. Which is considered quite a troublesome security attack vector. If WPF/Silverlight were to keep a DP for Password it would require the framework to keep the password itself unencrypted in memory. The reason the WPF/Silverlight PasswordBox doesn't expose a DP for the Password property is security related. Never keep plain text passwords in memory. People should have the following security guideline tattooed on the inside of their eyelids: I put a breakpoint and sure enough the code enter the static helper class but it never updates my Password in my ViewModel. I have my TextBox, this is no problem, but in my ViewModel the Password is empty.Īm I doing something wrong or missing a step? In Login I send along to my service a Username and Password, Username contains data from my View but Password is Null|Empty private DelegateCommand loginCommand īool result = securityService.IsValidLogin(Username, Password) ![]() You can see I check my property for Username here which works great. When I press it CanLogin is called and if it returns true it calls Login. My code is very simple, basically I have a Command for my Button. When I had the PasswordBox as a TextBox and Binding Path=Password then the property in my LoginViewModel was updated. I used the code above as stated and entered this Username is fine and is working as it's a TextBox. I basically have properties in my LoginViewModel for Username and Password. It technically looks great, but I am unsure of how to retrieve the password. ![]() I found some interesting code here (has anyone used this or something similar?) It seems it's a security risk but I am using the MVVM pattern so I wish to bypass this. I have come across a problem with binding to a PasswordBox.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |