471,888 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,888 software developers and data experts.

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 3849
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 zermasroor | last post: by

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.