Odata 1-2 Windows Authentication and odata

Source: Internet
Author: User

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 ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.