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

  • Home
  • SEARCH
  • 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: You have an ASP.Net webpage that should display the next image in a
Scenario : I have a complex Asp.net app serving various units through programmatically constructed
Scenario: An event is raised in class A that needs to be handled by
Scenario: A VB6 library calls a method in a .NET-Assembly through COM and with
Scenario I'm parsing emails and inserting them a database using an ORM (NHibernate to
Scenario: Using jquery form plugin . The form appears in a dialog, created with
Scenario: A stored procedure receives from code a DateTime with, let's say DateTime.Now value,
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are
Scenario: I'm currently writing a layer to abstract 3 similar webservices into one useable
Scenario is that we send out thousands of emails through SMTP server. Content is

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.