473,624 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request for principal permission failed

Hi all,
I am running into a rather bizarre problem with one of my web
applications. I'm in the process of applying the
PrincipalPermis sionAttribute to a number of pages [at the class level]
and I've stumbled into a roadblock.

Problem Setup:
Forms Authentication
Windows XP sp1 + .NET 1.1 SP1

Problem Description:
When I access a page that I control via the
PrincipalPermis sionAttribute, I get a very specific set of errors, and
the error always occurs at the same location. The principal permission
attribute is declared as:

<PrincipalPermi ssionAttribute( SecurityAction. Demand,
Role:=SecurityR oles.Authorized )> _
Public Class Foo
Inherits App_Base ' which inherits from System.Web.UI.P age

What happens is that the code begins to execute normally. It calls an
private function which handles data binding and sets up a property on a
custom paging control. This same control has already been accessed in
the Page_Load event, but in this particular function the call suddenly
fails with a SecurityExcepti on [which is then caught and a call to a
generic error display routine is tried which also fails with a
SecurityExcepti on].

If I switch the declaration above to:
<PrincipalPermi ssion(SecurityA ction.Demand, Authenticated:= True)>

Everything works fine. If I switch it back to the original code and add
the following into the Page_Load() event:

Dim perm As New PrincipalPermis sion(Nothing, SecurityRoles.A uthorized)
perm.Demand()

Again, the perm.Demand() succeeds, but the call further down the page
[with the Page_Load event which did the original demand being in the
call-stack] fails with the doubled security exception again.

What is going on here? The same code I am using here was used without a
problem on previous projects and I never ran into this issue. The
imperative security that I put in Page_Load() succeeds, yet the
declarative security causes a failure...

Additionally, if the declarative security were to fail at any point, I
am a little concerned that logic from the Page_Load event is getting
fired when clearly there is something wrong with the
permission/principal object which is causing the error... It would seem
to me that it should be an "all or nothing" thing, not a "we'll go for a
while, and at some point I'll let you know that you don't actually have
permission to do what it is you are doing..."

Thanks!
Ben
Nov 18 '05 #1
0 2197

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4690
by: Marius Horak | last post by:
I have a window (not webservice) service written in c#. It's running under MyDomain/Administrator account. It fails to execute any store procedure. The error is: "Request for the permission of type System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed." Would it bt a 'pure' dotnet problem or service/SQL Server problem?
1
1833
by: Marius Horak | last post by:
I have a window application written in c#. It connects to a remote SQL Server but it fails to execute any store procedure. The error is: "Request for the permission of type System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed." I'm a new to dotnet and after reading a number of MSDN pages I have no idea
1
4371
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String *ipAddress = S""; IDictionary *server_config = dynamic_cast<IDictionary*>(ConfigurationSettings::GetConfig("ServerAddress") ); ipAddress = dynamic_cast<String*>(server_config->get_Item(S"IP"));
0
4547
by: Armin Braunstein | last post by:
Hi! I have a curious problem in my C# ASP .Net application (Visual Studio 2002, .Net Framework 1.0 SP3 (previously SP2 with the same error - following), Crystal Reports (shipped with Visual Studio)). In my page there is an ASP ImageButton. If i click on that a crystal report will be generated and written into a PDF file. After generating this button the Button clicked will be set' to invisible. Sometimes (every about 50 to 500 report...
1
9471
by: Rachel | last post by:
I have created a simple web service in VC# that adds two numbers. It returns an integer value to the client once invoked. I used Visual Studio .NET 2003, Windows XP Pro and .NET 1.1. I created a Windows form client. While debugging I get the following error : Unhandled Exception: System.Net.WebException: The request failed with HTTP status 401: Access Denied. in the following line:
8
13858
by: Bryan Dickerson | last post by:
The full message is: Request for permission of the type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. It happened while trying to execute a small program, from a network share, that will tests the correct installation of some ODBC/OLE drivers. It opens a specific registry key with My.Computer.Registry.LocalMachine and then does a quick SQL query...
2
20825
by: AnalogKid17 | last post by:
Keywords: ASP.NET app with VS2005 running on Win2003 with IIS6, and SQL2000 on a WinXP Box I've betting the following for days... it's driving me insane: Server Error in '/' Application. Security Exception Description: The application attempted to perform an operation not
0
2142
by: Siberwulf | last post by:
I'm trying to fetch an XML document from a website through an assembly i built and attached to SQL 2005. Here is my code for the SPROC assembly: public static void fetch_FeedData(string m_URL) { SqlPipe p = SqlContext.Pipe;
3
12048
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config) ---> System.Security.SecurityException: Request for the permission of type
5
8302
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: for the permission of type
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.