Re: Capturing Windows Username without popping challenge box in the browser

From: Prodip Saha (psaha_at_bear.com)
Date: 12/08/04


Date: Wed, 8 Dec 2004 09:06:44 -0600

Raj,
I think the problem is little different and simple. With Impersonation set
to True, you (impersonated account) must have the read access to the xml
file on the IIS server or whereever your xml file is located. To identify
this behavior you can grant yourself read permission to the folder where the
xml file is located but don't grant permission to others. Now only your
should be able to see the user control. If that's the case, you can grant
folder permission to everyone (if that's does not cause harm).

Note: If you don't impersonate make sure the ASPNET account has read access
to the xml file folder.

Hope this help.
Prodip Saha

"Raj Thakkar" <rthakkar@theage.com.au> wrote in message
news:1102493819.185598.170190@c13g2000cwb.googlegroups.com...
> Hi,
> I am currenty working on a site for intranet.
> I have a user control in the header of every page that will be
> displayed only if people with certain username are surfing the site.
> These lists of usernames is stored on the server side in a xml based
> file
>
> So what I am doing at the moment is inside the user control pageload
> method, i get the username of the current person logged in using
> HttpContext.Current.User.Identity.Name and if the username is within
> the list of 'allowed-access-usernames', I continue loading the
> usercontrol else I set its visibility to false
> so they can't see it.
>
> It all works fine if I try to access the site from localhost.
> The application grabs my windows username and verfies it against the
> list, if i am present in the list, I see the control else I don't
>
> The problem comes when I try to access the site from different machine.
> As soon as i try to access the page, IE pops up a window asking for
> username and password which I don;t want to.
> I want to just grab the username of currenty logged in user on the
> machine and give it to the server.
>
> Can anyone help me how do i achieve this?
>
> BTW, I am doing this using windows authentication.
> In the IIS 5.1, I have
> Anonymous Access unchecked
> Integrated Windows Authentication checked
>
> In web.config file
> I have windows authentication
> and
> <identity impersonate="true" />
>
>
> Thanks,
> Raj
>



Relevant Pages

  • Re: Username und Passwort sicher ablegen
    ... codiert in eine XML oder sogar in eine Datenbank ablegen. ... > mit Username und Passwort geschützt. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Servlet cant communicate with Database made using XML !
    ... > username and password through a Servlet, ... the Servlet has to just parse the XML document and verify the ...
    (comp.lang.java.databases)
  • Re: Username und Passwort sicher ablegen
    ... > mit Username und Passwort geschützt. ... > wieder die Source rausholen und somit auch den Username und das Passwort ... Und selbst wenn ich es Codiert im XML hinterlege... ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Securing XML documents on a ASP.net site....
    ... I need my aspx pages to work with these XML ... as corruption of the XML files when attempting to write to them. ... Impersonation did nothing to solve my problem and besides impersonation has ... > I meant not below your web site root ie. those documents are not ...
    (microsoft.public.dotnet.framework.aspnet)