0

I have a WPF application using WPF WebBrowser control. The appilcation is running on windows (as a Kiosk). The webbrowser is configured to show some service from the web. When the users try to sign in, that website redirect to the 3rd party Authentication Provider (SAML). After the user had successfully sign-ined, the 3rd party Authentication Provider redirect the user to the original website. And the original website shows the error that the website needs the "cookies to be enable".
When using the Windows Forms Browser inside the WindowsFormHost on the same WPF application, there's no such error.
On IE11 there's also no error.

The website and 3rd party Authentication provider is not under my control.

The WPF WebBrowser control in the application is forced to use IE11 through BrowserEmulation.

Can someone tell me why the WPF WebBrowser control behavior is different from the WindowsForm Browser control?

John Hpa
  • 463
  • 6
  • 18
  • 1
    I believe your best option is to [host the WinForms browser in a WindowsFormsHost](https://stackoverflow.com/questions/48959810/how-to-enable-cookies-in-wpf-webbrowser-control) – Mark Feldman Jul 23 '18 at 06:03
  • @MarkFeldman, yes. Thanks for your suggestion. But I'm baffled by the wpf webbrowser's control's behavior. On winforms browser control, there's no problem. And I understand that the two controls use the same underlying control. – John Hpa Jul 23 '18 at 06:15
  • 1
    I've had all manner of nightmares with the WPF WebBrowser control, they seem to have disabled a lot of functionality. They're also using an older version of the browser (IE8 I believe) which doesn't support all the backward compatibility stuff. – Mark Feldman Jul 23 '18 at 06:21
  • 1
    If you are looking for a decent web broswer control for WPF checkout: http://cefsharp.github.io – aydjay Jul 23 '18 at 06:44
  • @d347hm4n, yes I use CEFSharp for other projects. But for this one I needed to use WPF webbrowser control. Thanks for the suggestion though. – John Hpa Jul 23 '18 at 07:18
  • @MarkFeldman, I didn't know about that (IE8 being used underlying WPF WebBrowser Control). – John Hpa Jul 23 '18 at 07:19
  • 1
    Have you tried this code? https://stackoverflow.com/a/18333982/1768303 – noseratio Jul 24 '18 at 02:04
  • @Noseratio, I haven't tried that yet. I will try. Thanks. – John Hpa Jul 25 '18 at 05:41
  • @Noseratio I tried already, but it's not working. – John Hpa Jul 25 '18 at 06:10

0 Answers0