Re: Authentication/Impersonation Inconsistency

From: Paul Glavich [MVP ASP.NET] (glav_at_aspalliane.com-NOSPAM)
Date: 03/01/05


Date: Tue, 1 Mar 2005 22:54:09 +1100

Istead of using ACL's, try using the <location> element in your web.config
to set the particular user allowed to access a particular location (in your
case a specific .aspx page)

eg.
<configuration>
  <!-- allow only user1 to access page 1 -->
   <location path="page1.aspx">
      <system.web>
         <authorization>
            <allow users="user1"/>
            <deny users="*" />
         </authorization>
      </system.web>
   </location>
  <!-- allow only user1 to access page 2 -->
   <location path="page2.aspx">
      <system.web>
         <authorization>
            <allow users="user2"/>
            <deny users="*" />
         </authorization>
      </system.web>
   </location>
  <!-- allow all other authenticated users to access other pages -->
      <system.web>
         <authorization>
            <allow users="?"/>
            <deny users="*" />
         </authorization>
      </system.web>
</configuration>

-- 
- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
"whornak" <whornak@discussions.microsoft.com> wrote in message
news:708EAB11-E5CA-4464-8188-7EBB5416E9BB@microsoft.com...
> I am trying to use the Impersonation functionality but am getting
> inconsistent results.  Win 2000 w/ Visual Studio 2003 .NET Framework v1.1
in
> development mode.
>
> I have the following set in web.config:
>    <authentication mode="Windows" />
>    <identity impersonate ="true" />
>
> I also have changed IIS to not allow Anonymous Access
>
> I have changed the permissions on a couple of files to different users
that
> I have created.  Each of the files having only 1 different user given
> permission.
>
> 2 Problems:
>
> 1) Sometimes things happen as expected where, when moving from apsx to
aspx,
> I get promted for the username/password/domain and with the proper
> credentials get permission.  But all of a sudden it stops working and am
not
> given access when retrying with the same credentials on the same aspx page
> when nothing has changed.
>
> 2) When provided access via the username/login/domain credentials all
other
> pages that are accessed use that last set of credentials instead of the
> original, that being what the user is logged into the machine as.
>
> This isn't a major problem but shouldn't it only allow access and not
change
> anything?


Relevant Pages

  • Authentication/Impersonation Inconsistency
    ... Sometimes things happen as expected where, when moving from apsx to aspx, ... credentials get permission. ... given access when retrying with the same credentials on the same aspx page ... When provided access via the username/login/domain credentials all other ...
    (microsoft.public.dotnet.security)
  • Re: Access denied. You do not have permission to perform this action or access this resource.
    ... message when you try to connect to a Windows SharePoint Services Web ... I have brand new credentials on the server, not the "same" name as the ... Please let me know if other users with administrator permission can ... If you change the site owner to another user with administrator ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Win2003 server IIS 6.0 ASP 3.0 weird reading text files
    ... IE will pass credentials and the others ... Permission is a big issue. ... That means it could be running as the anonymous user under one ... Jeff ...
    (microsoft.public.inetserver.iis)
  • RE: 401.1 Error when calling an asp.net page from code.
    ... in aspx page A to call aspx page B. This works fine in our qa and dev ... Access is denied due to invalid credentials. ... StreamReader reader; ... XmlDocument xmlDoc = new XmlDocument; ...
    (microsoft.public.inetserver.iis)
  • Re: [PATCH 3/4] integrity: Linux Integrity Module(LIM)
    ... Lot of different things need ways of recording integrity status's. ... Peter, please read up what the credentials patches do, or how struct ... credentials patch is in. ... Even better operate on filesystems lacking all the need permission ...
    (Linux-Kernel)