Super secret. How to decode Base64 Basic Authentication!

OK, really not that secret.  Basic Authentication headers are pretty simple.   When the server returns 401 and the header: WWW-Authenticate: Basic.  The server wants you to send the username and password in this format:  jeff:mypassword and then encode this as a Base64String.  You can encode this with this code: string secret = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(“jeff:mypassword”));.  To decode a username and password from…

2

Using netsh to analyze WinInet problems in Windows 7 and Windows 8

There are some powerful tracing tools built into Windows 7 that can help you diagnose Internet Client issues.  This walk though shows you now to enable tracing when accessing a web site using Internet Explorer 8 or other WinInet based applications. Network tracing in Windows 7 (ref: http://msdn.microsoft.com/en-us/library/dd569136(VS.85).aspx)  uses Event Tracing for Windows (ETW) (ref:…

3

How to enable WinHttp Tracing on Vista, 2008 and Windows 7

WinhttpTracecfg.exe for Vista does not exist, so how can you get a WinHttp trace in Vista and above? WinHttpTraceCfg.exe has been replaced in Vista and above with the netsh winhttp command.see this blog:http://blogs.msdn.com/wndp/archive/2007/03/21/winhttp-configuration-for-windows-vista.aspx NOTE:  For 32 bit tracing on a 64 bit system you need to use the 32 bit netsh from the SysWOW64 directory. …

4

Using .NET HttpWebRequest class with SiteMinder you get a 403 or 401 error

Download Fiddler from http://fiddlertool.com and run this for an Internet Explorer browser session that successfully connects.   Then hit the same site with your .NET 2.0 client application and make sure you set the credentials in your code as well: http://msdn.microsoft.com/en-us/library/system.net.networkcredential.aspx  (Note you can set myCreds directly on the Credentials property of the HttpWebRequest object……

0

Troubleshooting code that uses the HTTP protocol

Overview You can solve issues encountered when using the HTTP protocol by applying the principles in this article.  By simplifying the issue into a small reproducible problem you can effectively troubleshoot and resolve most problems encountered in code that uses the HTTP protocol.  Crucial steps to troubleshooting code are: Gather Information, Simplify the Problem and…

4