The pest of Impersonation



I have an ASP Website setup which presents some data, then posts
changes to that data to another webpage (whcih is java based) by using
variables on the URL Line, the Java website trapps the user's details
and places some information against the closed call, such as who
closed it.

This works ok....and here's the code

string number = ((CloseParams)o).number;
string CloseText = ((CloseParams)o).closecomment;
WebClient wc = new WebClient();
wc.UseDefaultCredentials = true;

Uri uri = new Uri("http://callsite/getservices/
view_specific_update_action.cfm?number="
+ number + "&Resolution=" +
HttpUtility.UrlEncode(CloseText) + "&subclose=" +
HttpUtility.UrlEncode("Close Ticket"));
string result = wc.DownloadString(uri);

The website on the other side of this (callsite) is supposed to be
trapping the currently logged on user (through integrated
authentication) and placing the logged on user details on the call.

if you access the callsite through ie everything works fine.

However...by accessing my site wihch is in ASP.NET that information
does not get passed through.

If in my code I do

Debug.WriteLine(this.User.Identity.Name.ToString());

I get the username of the currently logged on user to my asp.net
site....which is what I would expect. That user should be what is
passing across to the other site....surely???

The guys who own the Java site are saying they are seeing the server
that my site is running on as the account that is closing tickets..

I've made a few changes to things

I've tried setting Impersonate = true and false in web.config.

I've tried changing the identity in the App Pool to Local Service and
Local System

I've tried changing the code to run the old fashioned way:

HttpWebRequest req =
(HttpWebRequest)WebRequest.Create(uri.ToString());
string username =
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
EventLog.WriteEntry("AutoGen close tool", "User " + username +
"\n" + "Executed the URL: " +
uri.ToString());
WebResponse response = req.GetResponse();
StreamReader sr = new
StreamReader(response.GetResponseStream());
string tmp = sr.ReadToEnd();

i.e. using Webrequest instead of WebClient

I've also tried doing an explicit impersonation

HttpWebRequest req =
(HttpWebRequest)WebRequest.Create(uri.ToString());

System.Security.Principal.WindowsImpersonationContext
impersonationContext;
impersonationContext =

((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();

string username =
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
EventLog.WriteEntry("AutoGen close tool", "User " + username +
"\n" + "Executed the URL: " + uri.ToString());

WebResponse response = req.GetResponse();
StreamReader sr = new
StreamReader(response.GetResponseStream());
string tmp = sr.ReadToEnd();

but none of that works!

How can I put the call across to the Callsite website using the
credentials of the user thats accessing my website?

Cliff.

.



Relevant Pages

  • Re: The pest of Impersonation
    ... What type of authentication is used on the ASP.NET site? ... string CloseText = o).closecomment; ... The website on the other side of this is supposed to be ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Help: Problem with ASP.NET 2.0 with VS 2005
    ... website using VS 2005 with option of File System. ... Exception Details: System.InvalidOperationException: Failed to map the path ... System.Web.Hosting.HostingEnvironment.MapPathActual(String virtualPath, ... ring virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cannot access https or windowsupdate
    ... I can connect to any other website. ... Because of a court decision Microsoft will stop all Java support after 30 ... Sun also offers an automatic download and install of the 1.4 Java plug-in ... Replies are posted only to the newsgroup for the benefit or other readers. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Broswer closes when an button is clicked which should not.
    ... > ...only tick the JIT compiler box and leave the Java boxes un checked ... > Henri Leboeuf ... it is connecting to the proper web site pages. ... When I clicked a html button in my website home page, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • problems by sending email with c# and web.config in a webserver Win 2003
    ... I'm using a website made in .NET with C#, when I'm running my site from ... MailAddressCollection recipients, String deliveryNotify, ... String defaultSubject, String defaultBody, OnSendingMailDelegate ...
    (microsoft.public.dotnet.general)