c# - Pass username/password from Windows Forms application to an ASP.NET web application -
here situation:
- c# windows forms application
- asp.net web application
- both authenticate custom user table in same database (usename/password) , create user object used throughout both applications
a user logged windows forms application , want launch url open page in asp.net web application in default browser (ie, chrome, firefox, etc.). want pass current username/password windows forms application asp.net web application in order keep user having log web application separately.
based on our research, here options have found (and drawbacks):
- pass username/password in url querystrings , create user object in web application
- not secure (password visible in url)
- create temporary html page on client machine includes javascript onload function posts username/password target url , create user object in web application
- (could not find way post data directly url , display url in default browser using c#)
- not secure (password visible in temporary page)
- create "handoff" table store username/password key gets passed page via querystring , deleted table when page loads , create user object in web application
- small potential key intercepted (hackers)
- have separate mongodb stores user object , retrieve in web application
- separate software (mongodb) running - additional point of failure
all of user doesn't have type username/password twice log both applications.
which 1 of above options above work best (most secure, least overhead/maintenance)?
or
is there way create forms authentication ticket (cookie?) in c# application used default browser?
or
is there better, secure method handling this?
(edit)
or
is there argument requiring user enter username/password again access web application if they're authenticated windows forms application? if so, can provide links references? best practices, web security standards, etc.
you salt+md5 password , send url.
however, should point script on server first, authenticates user and creates appropriate cookies, , redirects desired page, without credentials in url.
edited: or whatever want preserve users' session
unfortunately, long passwords involved, can't 100% secure. still, hashing salted (salting when concatenate password other string before hashing) password might best bet if can visual on passwords.
- you generate password hash, salt.
- you send processed (i put url of separate script, it's matter of preference.)
- you generate hash same salt on server , check against submitted one.
- authenticate user , redirect original location.
Comments
Post a Comment