Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 143997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:11:01+00:00 2026-05-11T08:11:01+00:00

Scenario I’m using a Custom IPrincipal and IIdentity to do asp.net authorization. I set

  • 0

Scenario

I’m using a Custom IPrincipal and IIdentity to do asp.net authorization. I set the Principal and Identity during the PostAuthenticateRequest event using an IHttpModule.

The web.config looks approximately like the following:

<system.web>   <authorization>     <allow verbs='GET,POST' roles='domain\group'/>     <deny verbs='*' users='*'/>   </authorization> </system.web> <location path='~/admin/user_search.aspx'>   <system.web>     <authorization>       <allow verbs='GET,POST' roles='admin'/>       <deny verbs='*' users='*'/>     </authorization>   </system.web> </location> 

The Problem

When making a request the IPrincipal.IsInRole method gets called once to check domain\group but doesn’t get called again to check the admin role. What is causing this? Do I have the location syntax incorrect or is there a deeper issue?

Notes

I thought initially that the web.config in the admin directory was overriding the web.config in the root directory, but I’ve tried removing it altogether as well as using it for the location element. Neither have worked so far.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:11:02+00:00Added an answer on May 11, 2026 at 8:11 am

    Don’t use the tilde (~) at the start of paths for <location> elements, as they are not interpreted there. In your example, path=’admin/user_search.aspx’ should be correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: My general portal is hosted in IIS using ASP.NET and a login page.
Scenario : I have an ASP.NET MVC application developed in Visual Studio 2008. There
Scenario: You have an ASP.Net webpage that should display the next image in a
Scenario : I need to create a report for the auditors for an ASP.Net
Scenario: I have a ASP.NET 3.5 WebForms based website. It contains Foo.aspx , Bar.aspx
Scenario first :- I'm using Entity Framework to do some queries, to build my
Scenario While using the Maven Ant Task artifact:deploy , I'm encountering the error java.lang.OutOfMemoryError:
Scenario : I'm currently trying to build a poor man's Google Maps using scripts
Scenario: During Hive COnfiguration, when I enter hive-dir-path$ bin/hive, I get the error as:
Scenario: Windows server in a AD domain hosting a Subversion repository using SVNSERVE only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.