0

I need to write an iis asp.net module that requires win authentication in very specific circumstances that can't be configured using iis configuration alone.

Essentially,

If complex conditions are true... Then Force windows authentication (kerberos or ntlmv2) Else Proceed without authentication

Can anyone suggest a away to do this with out having to write the auth implementation?

T.Rojan
  • 111
  • 7
  • wtf - I posted this question but unless I'm hallucinating the text above is not what I wrote. s/o rephrased it for me. – T.Rojan Apr 17 '14 at 10:37

1 Answers1

0

In your http module you can just return the appropriate http header, e.g.

System.Web.HttpContext.Current.Response.Status = "401 Unauthorized"
System.Web.HttpContext.Current.Response.AddHeader("WWW-Authenticate", "NTLM")
System.Web.HttpContext.Current.Response.End()

I've done that on a project in .NET 1.0 back in the day, but it should still work. I don't know about kerberos, but this should get you started.

Peter Hahndorf
  • 10,767
  • 4
  • 42
  • 58