473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 3918
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
15
by: Sims | last post by:
Hi, I have a service that need to access the current user registry from time to time. But a service only works as a SYSTEM and not as the current user. How can i change that? Or at the very...
6
by: Frank Meng | last post by:
Hi. Can system service identify current active user with .net? I need current active user's logon name from system service. I tried WindowsIdentity.GetCurrent().Name and it gave me "NT...
4
by: Terry Mulvany | last post by:
I have a 'BasePage' (BasePage.cs) derived from System.Web.UI.Page that all my pages inherit from. I need to set some properties (either in the OnInit or constructor) based on a potential...
8
by: A P | last post by:
Hi! I'm using ASP.Net Web Matrix on my PC and wanting to publish the files to our server. I try to copy (thru explorer) the files but it didn't work! I receive Runtime Error: Server Error...
0
by: masago | last post by:
Hi....how are you ?? they can help me to solve this problem ?? Access to the path = "c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET = Files\reports\06639073\bbab30a7" is...
4
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ...
0
by: =?Utf-8?B?QW50b25pbyBPJydOZWFs?= | last post by:
We changed a username in AD. The user now logs on to a computer on our network using the new username without any problems. They can not logon using the old username. However, when they access a...
7
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using this code to get groups for a user and getting a error (5) on the GetAuthorizationGroups() function . There are two domains. This function works on the local domain but does not work...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.