asp.net mvc - Login password encryption with active directory -
my mvc5 application usage active directory , unable use default .net provided password encryption ad doesn't support it.
my controller is:
[httppost] [validateantiforgerytoken] public actionresult login(account user) { if (modelstate.isvalid) { if (membership.validateuser(user.username, user.password)) { var principal = user.getuserprincipal(user.username, user.password, user.domainname); if (principal != null) { formsauthentication.setauthcookie(user.username, user.rememberme); var returnurl = getredirectfromloginurl(); if (url.islocalurl(returnurl)) return redirect(returnurl); else return redirecttoaction("index", "home"); } else modelstate.addmodelerror("", "user principal not created."); } else { modelstate.addmodelerror("", "login data incorrect!"); } } else modelstate.addmodelerror("", "login data incorrect!"); return view("login", user); }
the login works fine have security issue. can see username, password, domain, etc. in clear text when capture data using ie9 developer tools (screen below):
__requestverificationtoken=s-dkcsoudftysobh4fj...&username=test&password=testpassword&domainname=domainname
web.config has code:
<membership defaultprovider="admembership"> <providers> <clear/> <add name="admembership" type="system.web.security.activedirectorymembershipprovider" connectionstringname="adconn" attributemapusername="samaccountname" /> </providers> </membership>
please how encrypt or hide password.
looks default behaviour in ie developer tools. tried login in google, microsoft sites , shows password in plain text.
i dont know if security issue in ie or not how behaving.
steps view passwrod:
- open gmail or live.com in ie9 (i tried in ie9)
- f12 (open developer tools) -> go network tab
- click start capturing button
- enter username/password (you can enter test)
- click stop capturing , go detailed view
- in grid click on post row , go "request body" tab
- see code password plain text @ last of _requestverificationtoken......
if finds better solution, please let me know.
Comments
Post a Comment