473,804 Members | 2,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible to get a NetworkCredenti al object from the current

YK
Hi

I have a Web Application that connects to Exchange WebDAV using a class that
I found on http://www.codeproject.com/dotnet/exdav.asp.
This class requires a NetworkCredenti al object in order to authenticate the
HTTP request against the Exchange server, and since that my WebApp is
configured in the IIS to use ONLY Integrated Windows Authentication I have
the Windows identity object from which I can get only the user name.

Is there a way to get a NetworkCredenti al object of the current user that is
connected to this web page?

I tried to impersonate the current user and use DefaultCredenti als property
but it returned null. I get the same problem when I connect to webservices
that I created from other web applications.

Thanks in advance,

Yuval
Jul 4 '06 #1
2 2971
if you are using Exchange, you probably already have the username and
password of the user
from theire login to the machine or your webApplication. ..

just use that

Private mailCredentials As New Net.NetworkCred ential("USERNAM E", "PWD")
--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
"YK" <YK@discussions .microsoft.come screveu na mensagem
news:FC******** *************** ***********@mic rosoft.com...
Hi

I have a Web Application that connects to Exchange WebDAV using a class
that
I found on http://www.codeproject.com/dotnet/exdav.asp.
This class requires a NetworkCredenti al object in order to authenticate
the
HTTP request against the Exchange server, and since that my WebApp is
configured in the IIS to use ONLY Integrated Windows Authentication I have
the Windows identity object from which I can get only the user name.

Is there a way to get a NetworkCredenti al object of the current user that
is
connected to this web page?

I tried to impersonate the current user and use DefaultCredenti als
property
but it returned null. I get the same problem when I connect to webservices
that I created from other web applications.

Thanks in advance,

Yuval

Jul 4 '06 #2
YK
Well, not exactly... I can access the username using
System.Security .Principal.Wind owsIdentity.Get Current().Name but I can't get
the user's password or domain...

If I try to use System.Net.Cred entialCache.Def aultCredentials it returns null.

Any ideas??

"Bruno Alexandre" wrote:
if you are using Exchange, you probably already have the username and
password of the user
from theire login to the machine or your webApplication. ..

just use that

Private mailCredentials As New Net.NetworkCred ential("USERNAM E", "PWD")
--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
"YK" <YK@discussions .microsoft.come screveu na mensagem
news:FC******** *************** ***********@mic rosoft.com...
Hi

I have a Web Application that connects to Exchange WebDAV using a class
that
I found on http://www.codeproject.com/dotnet/exdav.asp.
This class requires a NetworkCredenti al object in order to authenticate
the
HTTP request against the Exchange server, and since that my WebApp is
configured in the IIS to use ONLY Integrated Windows Authentication I have
the Windows identity object from which I can get only the user name.

Is there a way to get a NetworkCredenti al object of the current user that
is
connected to this web page?

I tried to impersonate the current user and use DefaultCredenti als
property
but it returned null. I get the same problem when I connect to webservices
that I created from other web applications.

Thanks in advance,

Yuval


Jul 4 '06 #3

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

Similar topics

0
1154
by: Eddie Lipshultz | last post by:
I'm working with the NetworkCredential class. I'm making the correct call and it returns that everything is okay using: NetworkCredential sc = new NetworkCredential("MyAccount", sPassword, myURL); However, I then need to make a call using HTTPS to a URL which changes the password. For example:
1
1670
by: surya | last post by:
Hi, I have a COM+ out of proc service that is configured to impersonate the user making the call to the COM+ service. Is there a way to create a NetworkCredential object based on the current thread's security? Using System.Net.CredentialCache.DefaultCredentials always returns the credentials of the user configured to run the out of proc COM+ server and not the credentials of the user set on the current thread. Regards
2
19071
by: Prathiraj | last post by:
Hi All, I'm trying to access a web page from C# code. Since I'm behind a firewall/proxy, I creat a webproxy and NetworkCredential to access the web page. It works fine. In this way, I have to give the username and password for creating the NetworkCredential object. Is there anyway that I can get the NetworkCredential object from the logged on user?
4
19867
by: Prehaut Anselme | last post by:
Hi, I need to create a WebRequest with an automatic proxy I have the specification of this porxy (host & port) I ask the user their own login and password, but the proxy tells me that the connection need an authentification. During the creation of a NetworkCredential you can define the login, the
14
1482
by: Ray5531 | last post by:
I have a console application in my local computer which I like to use remoting in it,to instanciate an object (MyClass.dll) in a web application(its bin folder) in a completely seperated box(in the same domain thought) .I have two questions: 1)Is my case covered in "Remoting objects hosted in IIS" topic?Are they same? 2) How should I authenticate to IIS from my console application? Do I really need to authenticate to IIS before...
3
13636
by: Peter Lapic | last post by:
I am running an VB.Net app which calls an ASP.Net Web Service and this service accesses SQL Server. The Web Service & SQL Server run on separate Windows 2000 server on the same domain. As we don't use Kerberos, the only means to flow the original user credentials from the VB.Net app right thru to SQL Server is to set the web service object credentials parameter in the VB.Net app. The credentials is created based on the following code...
3
6935
by: Patrick Fogarty | last post by:
I am programming what is to be a web service client that will use an HTTP-POST to request and retrieve data. The remote server (written in java for what it's worth) requires basic authentication as per RFC 2617 (http://www.faqs.org/rfcs/rfc2617.html). My attempts to authenticate are failing. The server requires the header to be present with the request. For security reasons, it will not reply in any way if the header is not present. ...
0
1174
by: steve | last post by:
Hi We have an application that send webRequests to a server using a specified user accounts. These requests will often be for different users. The problem we have is that the webRequest, even though it is a fresh object that is disposed of, will always use the first newtowrkCredntial we specify. We are NOT using credentialCache as we dont want to cache the credentials. Anyone know why this is and how to prevent / workaround this?
3
6771
by: antonyliu2002 | last post by:
I have a website (call it WinAuthWeb) that uses Integrated Windows Authentication. In my ASP.NET web application, I collect user name, password and domain info and pass them to WinAuthWeb for authentication (formerly known as NTLM). I construct the user credentials like this: theUserCredential = New NetworkCredential(username, userpassword,
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7635
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6863
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.