I have successfully created a WCF service using the webHttpBinding with no authentication or security. I can call my function over and over and it returns the value as expected.
Now I created a custom IAuthorizationPolicy, UserNamePasswordValidator and IPrincipal. I went back to wsHttpBinding (default) and did a normal service reference in code and set the ClientCredentials.UserName.UserName and ClientCredentials.UserName.Password appropriately and the service works perfectly fine. I modified the Username to be wrong just to ensure the code was firing and sure enough it failed.
So, I put the binding back to webHttpBinding, but now I cannot figure out how to set those credentials via jQuery. I have tried setting the "Authorization" header to a base64 encoded string using the following http://stackoverflow.com/questions/1002179/how-can-i-pass-windows-authentication-to-webservice-using-jquery. No matter what i do i always get the error "No custom principal is specified in the authorization context".
Anyone have info on how to properly call a WCF REST service that is using a Custom Principal?