469,270 Members | 1,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Re: How to Get System.Net.ICredential of Current User?

On Jun 18, 12:57*pm, "Joe Kaplan"
<joseph.e.kap...@removethis.accenture.comwrote:
Why do you say this does not work?
-----------------------

Because when I execute:

sendmailproxy.SendEmailRequest(sendmail);

I get:

System.Net.WebException from System.Web.Services

The request failed with HTTP status 401: Unauthorized.
Remember, this web service that I am using is a produced locally at
the company where I work, and I have access to their developers. Is
there some [web attribute] or something on their end that they need to
enable or disable?

Thanks
Jun 27 '08 #1
3 3745
Also,

On my computer System.Net.CredentialCache.DefaultCredentials is
System.Net.NetworkCredential in which all three (3) fields are
System.String.Empty:

1. Domain
2. Password
3. UserName

Do I need to configure something on my computer to get data populated
into these three fields?

BTW, I would expect the Password field to be encrypted; otherwise a
user application can get the password and save it to a database or
something.
Jun 27 '08 #2
Did you set the Credentials property of your web service proxy to
DefaultCredentials? I assume you did this, but your code didn't show it, so
thought I'd ask.

If you did that and it still fails, then the next thing to do would be to
examine the security event log on the remote server you are contacting and
find out what happened with the authentication. You would want to make sure
they have auditing enabled for logon events (success and failure) so you can
see what credentials it attempted to use when you logged in.

This also assumes that there is some sort of a trust relationship between
the user executing the local code and the remote server (same domain, etc.).

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
<ri*************@raymondjames.comwrote in message
news:d7**********************************@c58g2000 hsc.googlegroups.com...
On Jun 18, 12:57 pm, "Joe Kaplan"
<joseph.e.kap...@removethis.accenture.comwrote:
Why do you say this does not work?
-----------------------

Because when I execute:

sendmailproxy.SendEmailRequest(sendmail);

I get:

System.Net.WebException from System.Web.Services

The request failed with HTTP status 401: Unauthorized.
Remember, this web service that I am using is a produced locally at
the company where I work, and I have access to their developers. Is
there some [web attribute] or something on their end that they need to
enable or disable?

Thanks
Jun 27 '08 #3
Hi,

additionally to what Joe wrote... does the WebService accept NTLM or
Kerberos authentication? If only basic authentication is enabled, the
default credentials cannot be used.

Kind regards,
Henning Krause

"Joe Kaplan" <jo*************@removethis.accenture.comwrote in message
news:ez**************@TK2MSFTNGP02.phx.gbl...
Did you set the Credentials property of your web service proxy to
DefaultCredentials? I assume you did this, but your code didn't show it,
so thought I'd ask.

If you did that and it still fails, then the next thing to do would be to
examine the security event log on the remote server you are contacting and
find out what happened with the authentication. You would want to make
sure they have auditing enabled for logon events (success and failure) so
you can see what credentials it attempted to use when you logged in.

This also assumes that there is some sort of a trust relationship between
the user executing the local code and the remote server (same domain,
etc.).

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services
Programming"
http://www.directoryprogramming.net
--
<ri*************@raymondjames.comwrote in message
news:d7**********************************@c58g2000 hsc.googlegroups.com...
On Jun 18, 12:57 pm, "Joe Kaplan"
<joseph.e.kap...@removethis.accenture.comwrote:
>Why do you say this does not work?

-----------------------

Because when I execute:

sendmailproxy.SendEmailRequest(sendmail);

I get:

System.Net.WebException from System.Web.Services

The request failed with HTTP status 401: Unauthorized.
Remember, this web service that I am using is a produced locally at
the company where I work, and I have access to their developers. Is
there some [web attribute] or something on their end that they need to
enable or disable?

Thanks
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Penn Markham | last post: by
4 posts views Thread by Terry Mulvany | last post: by
8 posts views Thread by A P | last post: by
reply views Thread by =?Utf-8?B?QW50b25pbyBPJydOZWFs?= | last post: by
7 posts views Thread by =?Utf-8?B?SmVycnkgQw==?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.