How can I grant anonymous access to an httpHandler that uses wildcards in a site that requires authentication?
<p>I have an application which requires authentication, but has some related services which can call into the application as anonymous. The calls are made via httpHandlers, some of which use wildcards. For the httpHandlers that do not use wildcards, I can manage the security by using the location element in web.config:</p>

<pre><code>&lt;httpHandlers&gt;
  &lt;add verb="*" path="ProcessFile.ashx" type="..." validate="false" /&gt;
  &lt;add verb="*" path="DoSomethingElse.*.*.ashx" type="..." validate="false" /&gt;
&lt;/httpHandlers&gt;
</code></pre>

<p>For the first handler, it was easy (closing tags omitted for brevity):</p>

<pre><code>&lt;location path="ProcessFile.ashx"&gt;
  &lt;system.web&gt;
    &lt;authorization&gt;
      &lt;allow users="?" /&gt;
    ...
</code></pre>

<p>The second handler won't work because location will not take wildcards. I tried using a 'directory' but it doesn't seem to work:</p>

<pre><code>&lt;httpHandlers&gt;
  ..
  &lt;add verb="*" path="test/DoSomethingElse.*.*.ashx" type="..." validate="false" /&gt;
&lt;/httpHandlers&gt;


&lt;location path="test"&gt;
  &lt;system.web&gt;
    &lt;authorization&gt;
      &lt;allow users="?" /&gt;
    ...
</code></pre>

<p>Is there a way to get this to work? Do I have the syntax wrong in some way?</p>
