Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is it possible to get a NetworkCredential object from the current

Reply
Thread Tools

Is it possible to get a NetworkCredential object from the current

 
 
=?Utf-8?B?WUs=?=
Guest
Posts: n/a
 
      07-04-2006
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
 
Reply With Quote
 
 
 
 
Bruno Alexandre
Guest
Posts: n/a
 
      07-04-2006
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")


--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)


"YK" <(E-Mail Removed)> escreveu na mensagem
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?WUs=?=
Guest
Posts: n/a
 
      07-04-2006
Well, not exactly... I can access the username using
System.Security.Principal.WindowsIdentity.GetCurre nt().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??

"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.NetworkCredential("USERNAME", "PWD")
>
>
> --
>
> Bruno Alexandre
> (a Portuguese in Københanv, Danmark)
>
>
> "YK" <(E-Mail Removed)> escreveu na mensagem
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
*Busy* *Busy* is offline
Junior Member
Join Date: Mar 2010
Posts: 1
 
      03-24-2010
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to show an iframe's current location (current URL) liketofindoutwhy@gmail.com Javascript 1 03-19-2008 10:20 PM
Does NetworkCredential itself encrypt user credentials? antonyliu2002@yahoo.com ASP .Net 3 07-09-2007 07:42 PM
NetworkCredential IveCal Java 6 04-20-2006 02:42 PM
Using NetworkCredential then a Redirect to the site requiring the credientails Jay Douglas ASP .Net 4 03-06-2004 04:36 PM
Two Web Services using same NetworkCredential? wgo ASP .Net Security 0 10-14-2003 01:35 AM



Advertisments