[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

NTLM Authentication .net cf 1.0

Posted on 2006-06-14
3
Medium Priority
?
449 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
umahesh earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

649 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