Windows Authentication and odata
1. Server Side
1) Integrated Authentication
When IIS is used as the service host, you must enable integrated authentication to disable anonymous authentication.
Windows authentication requests contain the following HTTP headers)
WWW-Authenticate: NTLM
WWW-Authenticate: negotiate
NTLM means that you need to use Windows authentication.
Negotiate means that the client can try Kerberos authentication.
2) Basic Authentication
When you configure IIS as basic authentication
The server returns 401 as follows:
WWW-Authenticate: Basic realm = "mydomain.com"
This information tells the client that an identity credential must be provided to mydomain.com.
Basic authentication is simple, but not secure, unless you use https
2. Client
1) Browser
In most cases, a logon box is displayed to the user when you encounter http401.
2). Net client applicationProgram
If your program runs on WindowsCodeAs shown below
Mydatacontext CTX = new mydatacontext (URI );
CTX. Credentials = system. net. credentialcache. defaultcredentials;
If your program runs on a non-Windows system, consider the following code:
CTX. Credentials = new networkcredential ("username", "password", "Domain ");
Silverlight 4:
CTX. usedefacrecredentials = true;
Http://blogs.msdn.com/ B /astoriateam/archive/2010/05/10/odata-and-authentication-part-2-windows-authentication.aspx ()