Solved

NTLM Authentication .net cf 1.0

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

825 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