6

As far as I understand WebRequest.PreAuthenticate is almost always good.

If I enable it even when there is no credential it won't try to authenticate, if there is a credential it'll. So is there any legitimate reason to set it False? Or is it OK to set it True even when there is no credentials?

And since it's quite useful why it's not enabled by default just like many other HTTP features?

1 Answer 1

5

Rick Strahl has a very detailed blog post about this.

To summarize, if you need to be able to change the credentials in the request at some point (without the server intervention), do not set PreAuthenticate to true. Otherwise, go for it.

1
  • Great, that means I'll leave it True all the time.
    – dr. evil
    Mar 27, 2010 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.