Is it possible to get a NetworkCredential object from the current

G

Guest

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 NetworkCredential 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 NetworkCredential object of the current user that is
connected to this web page?

I tried to impersonate the current user and use DefaultCredentials 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
 
B

Bruno Alexandre

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.NetworkCredential("USERNAME", "PWD")
 
G

Guest

Well, not exactly... I can access the username using
System.Security.Principal.WindowsIdentity.GetCurrent().Name but I can't get
the user's password or domain...

If I try to use System.Net.CredentialCache.DefaultCredentials it returns null.

Any ideas??
 
Joined
Mar 24, 2010
Messages
1
Reaction score
0
WindowsIdentity to NetworkCredential

I've asked this question here: forums.asp.net/p/1539142/3747362.aspx#3747362
I, like you, am still waiting to hear if this can be done.

Also, if you print out the user name of the windows identity (or view the value in the debugger), you'll notice that if the page visitor is on a domain, it will be included in the username as "<domain>\<username>" and you can parse out the domain if necessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top