473,796 Members | 2,632 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 2969
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
1152
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
1668
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
19069
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
19865
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
1480
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
13635
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
6934
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
1173
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
6770
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
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
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
6788
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
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4116
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
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.