I'm working on a WCF Web Service, I need to use Basic Authentication over HTTPS and should validate against LDAP for Security and Authentication.
public class BasicAuthenticationModule: IHttpModule
{
public void Init(HttpApplication context)
{
context.AuthenticateRequest
+= new EventHandler(context_AuthenticateRequest);
}
void context_AuthenticateRequest(object sender, EventArgs e)
{
}
}
I used the Code from this link for building the above said part.hooked the AUTHENTICATE_REQUEST event to handle the Authentication required for my service.
I'm having the following issue: When I open the service in Browser, before I can enter the credentials it enters the Authenticate request event handler and since Authorization header is not available it asks for credentials. But after I enter the credentials it is not getting inside the AUTHENTICATE REQUEST event handler but this time the Authorization Header is available but could not authenticate it and hence I'm not able to access the WCF service and it throws I'm not authorized.
Please let me know how can I make the Authenticate request to be called for every request??
I'm helpless with the issue.