Kerberos and load balancers

Kerberos is a ticket-based authentication protocol, which requires deep understanding to make it work properly. Information about setting it up is somehow scattered over the web, so it took me some time to find relevant reads. In my previous post I wrote about my initial experience with Kerberos and I want to share some more in this one.

Working in a load-balanced environment introduces (administrative) complexity to your system and Kerberos is no exception to this. In this post I will focus on setting your IIS (>= 7.0) correctly up to work with Kerberos in such scenarios. Continue Reading…

Model binding in ASP.NET MVC can be fun

Model binding is a technique that allows you to map data to your controller actions in ASP.NET MVC. In the old days one would manually call Request["param"] to get the value of а parameter, but this could quickly become annoying as you get many parameters (f.x., via form POST). Model binding abstracts away this tedious activity and allows us to focus on designing our controllers. The process itself looks like this:

Model binding mechanism

A nice bonus is that we can map our models from any kind of request, for example a form POST or AJAX. Continue Reading…

HttpWebRequest keeps timing out

It has already happened to me a couple of times and every time I forget what the issue was and how to solve it. That’s why I decided to write a short post about it, so hopefully next time I will remember. 🙂 The problem arises when making a few (independent) HTTP requests using C#’s HttpWebRequest. At first it sounds like a very usual thing to do, but the mystical part of it is that the first few requests succeed and then at a certain point the others start timing out. You may be tempted to increase the Timeout first, but you will soon understand that it does not solve the problem. Continue Reading…

Bundling AngularJS HTML pages with ASP.NET

image_6Bundling and minification are two well-known techniques used to improve the load time of your website. These are especially important for sites that use extensively JavaScript to offer better user experience. There are plenty of tools to help you do bundling and minification of JavaScript and CSS files. If you are a .NET developer you are probably very used to live inside Visual Studio and expect it to offer you everything you might think of. In ASP.NET 4.5 you can use a bundling API to define how your files will be grouped and sent to the client. The following example demonstrates the usage of this API.

Then in your page (either an ASP.NET page or a MVC view) you would invoke the rendering of these bundles by calling Scripts.Render(“~/bundles/jquery”) and Styles.Render(“~/bundles/css”). Continue Reading…