Solved

NTLM Authentication .net cf 1.0

Posted on 2006-06-14
3
430 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

14 Experts available now in Live!

Get 1:1 Help Now