473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Credentials lost when posting data

Hi,

I'm trying to send a post to a form on a webserver that requires
credentials. When I log in it works just fine, but when I try to post data to
the webserver the credentials aren't transmitted.

my source:

CredentialCache myCache = new CredentialCache();

webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded");
myCache.Add(new Uri("http://" + ipAdr.Text ),"Basic",new
NetworkCredential("xx","xx"));

webClient.Credentials = myCache;
webClient.UploadValues("http://" + ipAdr.Text +
"/form/newData?protocol=2","POST",isdnOppgrader);
Is this the right way to do it?
I have also tried
myCache.Add(new Uri("http://" + ipAdr.Text +
"/form/newData?protocol=2"),"Basic",new NetworkCredential("xx","xx"));

and
myCache.Add(new Uri("http://" + ipAdr.Text/<the html file that IE uses when
it posts the data> ),"Basic",new NetworkCredential("xx","xx"));
any suggestions?
Nov 16 '05 #1
1 1666
I am wondering has anyone else tried to do this? I am working with a similar issue... trying to login to a web form, by posting the Username and Password fields, but I am not for sure how to do this... I have tried several different ways....
Hi,

I'm trying to send a post to a form on a webserver that requires
credentials. When I log in it works just fine, but when I try to post data to
the webserver the credentials aren't transmitted.

my source:

CredentialCache myCache = new CredentialCache();

webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded");
myCache.Add(new Uri("http://" + ipAdr.Text ),"Basic",new
NetworkCredential("xx","xx"));

webClient.Credentials = myCache;
webClient.UploadValues("http://" + ipAdr.Text +
"/form/newData?protocol=2","POST",isdnOppgrader);
Is this the right way to do it?
I have also tried
myCache.Add(new Uri("http://" + ipAdr.Text +
"/form/newData?protocol=2"),"Basic",new NetworkCredential("xx","xx"));

and
myCache.Add(new Uri("http://" + ipAdr.Text/<the html file that IE uses when
it posts the data> ),"Basic",new NetworkCredential("xx","xx"));
any suggestions


User submitted from AEWNET (http://www.aewnet.com/)
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mdh | last post by:
I have an application written for mod_perl and Apache that needs to be able to send some XML queries to a WebMethods server for access to corporate systems. I have been attempting to use LWP to...
3
by: Nipon | last post by:
Hi, I am using MS SQL Server 7.0 SP2 in Windows 2000 server SP4. I have one-to-many tables (TABLE_HEAD and TABLE_DETAILS)which I am going to update by using a stored procedure with UPDATE...
2
by: Andrew | last post by:
The site is configured for anonymous access. One area is configured with basic authentication. When the user clicks on a menu item they will request an .asp file in the anonymous part of the site...
2
by: Peter | last post by:
I have a link that refers to a page that requires authentication. Is there a way to set the logon credentials prior to or while posting to a new web page.... My users are clicking on the link...
2
by: Angelo Vargheese | last post by:
Hi, I am trying to retrieve XML created by ASP pages on different servers and display them on a single ASP.Net page. I was planning to use the XMLDocument and XMLResolver objects like below: ...
3
by: Wild Wind | last post by:
Hello, I have an application which calls a web service across the Internet from a client machine. The site that I have deployed the application to is such that to browse the Internet using a...
0
by: kkos | last post by:
I noticed the following issue posted as a double-hop issue in many discussion boards but found no answers that explain how to pass the second hop with windows auth from IIS ASPX page to remote SQL...
2
by: Wimpie van Lingen | last post by:
Hey I have some more questions with regards to Remoting in .NET 2. I'm using TCP with the Binary formatter. My solution consists of 4 projects: - Class Library containing the server classes...
5
by: =?Utf-8?B?SmltbWVy?= | last post by:
Hello, I've been trying to create a WCF SOAP Router Service that can forward not just the message body but also any security headers set by the originator of the message. The destination service...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.