In IIS, I can “ignore”, “allow” and “require” client certificates.
In ASP.NET WebAPI (version 4.0, which just started a little back), I seem to have the ability to “ignore” or “require”.
By default, client certificates are ignored ... therefore this statement always returns null:
var cert = actionContext.Request.GetClientCertificate();
But if I set this flag in my config:
config.ClientCredentialType = HttpClientCredentialType.Certificate;
Then I get the client certificate ... but I no longer have the ability to allow anonymous access.
Now my anonymous client receives error 403 : "The remote server returned an error: (403) Forbidden."
Can I make a kind of "allow" as in IIS?
source share