Return back a 403 or 401 through an access policy

Here is my scenario:

I have a webservice that is going to be invoked by some clients. I want to make sure that if their AD authentication fails, that they are sent back a 403 HTTP status code, as opposed to a webpage stating “Your session could not be established”. Likewise, if an AD query fails I want to return back a 401 HTTP status code.

Is this possible to do?

Yes. Look up “Clientless Mode” on devcentral here and find threads related to it and how to use “401 response”. If you have specific questions about it, let us know.