Validating clients using PKI authentication on windows Azure
===

I'm banging my head with this feature. The problem is that I would like to validade my users(computers) using PKI authentication.

I've created an Action Filter(MVC 3) like this:

public override void OnAuthorization(AuthorizationContext filterContext)
        {
            HttpContext context = HttpContext.Current;

            if (!context.Request.ClientCertificate.IsPresent)
                throw new UnauthorizedAccessException("You can't access this source, please select an certificate.");

            var clientCertificate = new X509Certificate2(context.Request.ClientCertificate.Certificate);
            X500DistinguishedName dName = clientCertificate.SubjectName;

            if (string.IsNullOrEmpty(dName.Name) || dName.Name != "CN=MyCertificateName.com")
            {
                throw new UnauthorizedAccessException("Invalid certificate!");
            }
        }

So the user have to send an valid certificate in HTTPRequest. The problem is that my users are computers, like "airport info stations". There is running an windows form application with an webbrowser component accessing my web site in an specific route.

The only thing that I have to do is validate theses machines using our certificate.

PS: My application is running on Windows Azure and I want to validate an specific rout in my website.

I'm looking for other suggestions.

Thanks!

