开发者

Webkit HTTPS Authentication

开发者 https://www.devze.com 2023-03-10 02:43 出处:网络
I am working on my first windows forms app to use WebKit.Net.I need to connect to an https site and popup an authentication form.Using .Net\'s built in browser, the authentication form pops up automat

I am working on my first windows forms app to use WebKit.Net. I need to connect to an https site and popup an authentication form. Using .Net's built in browser, the authentication form pops up automatically, but WebKit just drops me at the 401 Authentication error page, and I can't figure out how to make it authenticate. Any ideas?

Even if I can figure out how to do this in the core webkit library, I can then modify WebKit.Net to support it, but I can't even find that. I tried searching the chromium source to see how they handle it, but it was way over my head. Any help is appreciated.

~therealmitchconnors

UPDATE: WebKit.NET is built on WebKit's WinCairo port, which uses CFLite in place of Apple's closed CFNetwork dll. Evidently, CFLite does not support Authentication Challenge, which is the 'right' way to do this. So, I added some code in the WebResourceLoadDelegate to check for a username and password, and, if one was provided, but the header is not included, cancel that web request and re-call the navigate method, including the username and password. It's a really ugly hack, but it works. Check it out at webkitdotnet/therealmitchconnors.

Now to figure out how to clo开发者_运维百科se a question...


There is no way in the API to do this. See my update above for my workaround.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号