Solved

NTLM Authentication .net cf 1.0

Posted on 2006-06-14
3
431 Views
Last Modified: 2013-12-27
Hi,

I'm using .net cf 1.0 for transferring the xml file to the SharePoint site. The site requires NTLM authentication. Below written code does not work for the NTML authenticated sites, else works fine. Code snippet is as below:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
credential = new NetworkCredential(userName, password);

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(remoteFileURL);
Stream stream = null;
HttpWebResponse response = null;

FileStream file = new FileStream(localFileURL, System.IO.FileMode.Open);                  
request.Method = "PUT";
request.Credentials = credential;
request.PreAuthenticate = true;
request.AllowWriteStreamBuffering = true;
request.SendChunked = true;
request.ContentLength = file.Length;      
request.KeepAlive = true;
                        
stream = request.GetRequestStream();
byte[] buffer = new byte[512];
int len = 0;

while((len = file.Read(buffer, 0, buffer.Length)) > 0 )
{            
        stream.Write(buffer, 0, len);
}
stream.Flush();
stream.Close();      
file.Close();
      
response = (HttpWebResponse)request.GetResponse();
response.Close();

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

It returns internal server error 500. .net cf 1.0 does not support CredentialCache :(

Is there any work around to copy the file to the desired url?

Thanks,
FTSS
0
Comment
Question by:ftss
3 Comments
 
LVL 6

Accepted Solution

by:
umahesh earned 500 total points
ID: 16981366
Do you have both the devices on same or trusted domain.

Because, on the desktop, NTLM uses authentication information established when the user logs on. It requires the client and server to be on the same or trusted domains.

Since Windows CE does not allow a user to log in, it pops up a dialog box to extract the authentication information when NTLM authentication is required.

Read here for more details
https://thesource.ofallevil.com/technet/prodtechnol/wce/evaluate/multice.mspx

Goodluck
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now