473,606 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Because when I execute:

sendmailproxy.S endEmailRequest (sendmail);

I get:

System.Net.WebE xception from System.Web.Serv ices

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 3944
Also,

On my computer System.Net.Cred entialCache.Def aultCredentials is
System.Net.Netw orkCredential in which all three (3) fields are
System.String.E mpty:

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
DefaultCredenti als? 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******** *************** ***********@c58 g2000hsc.google groups.com...
On Jun 18, 12:57 pm, "Joe Kaplan"
<joseph.e.kap.. .@removethis.ac centure.comwrot e:
Why do you say this does not work?
-----------------------

Because when I execute:

sendmailproxy.S endEmailRequest (sendmail);

I get:

System.Net.WebE xception from System.Web.Serv ices

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.ac centure.comwrot e in message
news:ez******** ******@TK2MSFTN GP02.phx.gbl...
Did you set the Credentials property of your web service proxy to
DefaultCredenti als? 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******** *************** ***********@c58 g2000hsc.google groups.com...
On Jun 18, 12:57 pm, "Joe Kaplan"
<joseph.e.kap.. .@removethis.ac centure.comwrot e:
>Why do you say this does not work?

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

Because when I execute:

sendmailproxy.S endEmailRequest (sendmail);

I get:

System.Net.WebE xception from System.Web.Serv ices

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
4945
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 webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
15
2004
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 least get the service to launch an application as the current user and not the SYSTEM Many thanks
6
2823
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 AUTHORITY\SYSTEM" even I did logon. Thank you for your help in advance. Frank
4
5088
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 Request.Cookie or a name/value pair in Request.QueryString. But I am getting a 'System.NullReferenceException: Object reference not set to an instance of an object.' error when I try to view any aspx derived from this BasePage. I am using...
8
1832
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 in '/' Application. ---------------------------------------------------------------------------- ----
0
1772
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 denied.=20 Description: An unhandled exception occurred during the execution of the =
4
2069
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 ///my code start here (cs file) using System; using System.Data;
0
4775
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 IIS 6.0 web site where a programmer compares system.web.httpcontext.current.user.identity.name to a lookup table containing usernames they could not gain access with the new userid. We created a web page to show what...
7
16298
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 on the other domain. Other functions work on the other domain like get all the users and get all the groups and I can validate users on the other domain so I think I am communciating with the other domain OK just not with the...
0
8036
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8317
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6796
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3948
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.