wpfwebbrowser-controljive

Wpf WebBrowser control showing html source and not rendering page


I'm doing a WPF application that requires an OAuth login so I'm using a WebBrowser Control to make the authentication part. When I navigate to the login page everything works fine and the page is rendered correctly.

When I fill my credentials and click the login button the request for the next page in the login process runs ok but the next page is displayed as text and not rendered.

i.e.

<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://use.typekit.net/ezx0eeb.js"></script>
<script type="text/javascript">
    try {
        Typekit.load();
    } catch (e) {
    }
</script>
<link rel="stylesheet"
    href="https://s3-us-west-2.amazonaws.com/jive-static/jivestrap/1.0/jivestrap.min.css">
...etc..

Image of html not being rendered

I'm already setting the Internet Explorer compatibility registry key value to allow my app to render everything in ie9 mode.

RegistryKey myKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true);
if (myKey != null) {
  myKey.SetValue(System.AppDomain.CurrentDomain.FriendlyName, 9999);
}

Any ideas? Thanks


Solution

  • The problem was that the second Jive authentication page was sending the data with the content type application/x-ms-application. I'll be contacting Jive support to figure out why is the sending that HTTP header.