c# - Opening Url with Credentials -
we have knowledge base want link our desktop application help.
i've tried open default web browser have .htaccess credentials setup being prompted. don't want them have type in username , password since setting 1 application.
this causes them prompted everytime:
dim url = "http://mysite.com/index.php?/category/40/0/10/" process.start(url) i cannot put username , password in url anymore since ie9 doesn't support it:
http://username:pass@url.com <-- not supported newer browsers
i've tried use webbrowser control using ie4 instead of current. causing display incorrectly.
dim hdr = "authorization: basic " + convert.tobase64string(encoding.ascii.getbytes("myuser" + ":" + "password")) + system.environment.newline webbrowser1.navigate(url, nothing, nothing, hdr) i've tried make registry setting force ie9 wasn't able work. besides, i've read, if don't have ie9 won't matter.
any suggestions on how around this? want open secure webpage application!
thanks!
you can search see how basic authentication works before further coding. can use httpanalyzer or other tools seeing how browser sends username , passwords in header of request. use authentication part of header. have build new request or find ready framework you.
a basic authentication made 2 request/responses. browser doesn't know authentication @ first server announce him 401 reply code means browser should provide authentication. on, requests have authentication header encoded using base64 containing username , password.
Comments
Post a Comment