Questions tagged [principalpermission]

33 questions
1
vote
1 answer

PrincipalPermission on Method doesn't work if applied to Class

I have code that looks something like this: [PrincipalPermission(SecurityAction.Demand, Role = "RoleA")] class Foo { [PrincipalPermission(SecurityAction.Demand, Role = "RoleB")] public static bool Bar() { return true; } } If…
BRW
  • 354
  • 3
  • 18
1
vote
1 answer

Silverlight4 page and PrincipalPermission

I am using VS2010 to learn about Silverlight4 Business Application with the MVVM design pattern. Trying to figure out how to declaratively secure a SL4 view (either a Page or UserControl or ChildWindow). I recall in an ASP.NET 2.0 web application, I…
sheir
  • 393
  • 4
  • 9
1
vote
1 answer

How to secure a complete WCF service with PrincipalPermission's

I have a WCF service binding with netTcp with over 100 methods, I would like to secure all the methods based on a Windows User Group. I know you can put the attribute [PrincipalPermission(SecurityAction.Demand, Role = "MyWindowsUserGroup")] before…
dave
  • 43
  • 6
1
vote
0 answers

Caller identity (Network Service account) obtained by WCF service is out of date

We have a WCF service using TCP binding, hosted in a Windows service. The WCF service is called by an ASP.NET web application. When the WCF service is called, I would like to check whether the calling identity is a member of a particular local…
Michael Bednarek
  • 169
  • 1
  • 13
1
vote
0 answers

WCF Implementation in base class, PrincipalPermission Role in derived classes?

I have a few WCF services that all implement an All() method, so I made a generic base class that implements that All() method, but every WCF service call needs his own security role. public class QueryService where T : class { public…
Erwin
  • 3,060
  • 26
  • 24
1
vote
2 answers

.Net Role Authentication PrincipalPermission fails

I have a vb.net 3.5 application using PrincipalPermission class to ensure a user is a member of a role. The code works for some groups in Active Directory domain but not others. At first I thought the space was an issue but I checked 'Domain Users'…
Russell Hart
  • 1,842
  • 13
  • 20
1
vote
1 answer

Handling PrincipalPermission exceptions in MVC3

On my MVC application I decorated some of the methods of my controller with this: [PrincipalPermission(SecurityAction.Demand, Role = "Administrator")] public ActionResult Create(FormCollection collection) { try { ... } catch…
Lord of Scripts
  • 3,579
  • 5
  • 41
  • 62
1
vote
1 answer

Permissions Error when PrincipalPermission applied at class level

[PrincipalPermission(SecurityAction.Demand, Role = "ValidRole")] public partial class CustomerAdd : System.Web.UI.UserControl {.... } When I try the above code, I do not get the compile time error and the permissions are not applied. I am UNABLE…
dotnet-practitioner
  • 13,968
  • 36
  • 127
  • 200
0
votes
1 answer

Why does PrincipalPermission(Attribute) not respect authentication type?

IIdentity interface exposes AuthenticationType property which i would like to take into account because things are bit different if a user logs on with x509 or basic username/password auth, you know: [PrincipalPermission(SecurityAction.Demand, Role…
UserControl
  • 14,766
  • 20
  • 100
  • 187
0
votes
2 answers

Error Handling in WCF Service

With the following service method example:- [PrincipalPermission(SecurityAction.Demand, Role="BUILTIN\\Administrator")] public string GetTest() { try { return "Hello"; } catch (Exception ex) { throw ex; } } How do I get an error…
EzaBlade
  • 657
  • 1
  • 9
  • 23
0
votes
1 answer

PrincipalPermissionAttribute demand same role from multiple domains

Setup My WCF webservice runs on IIS 8.0 on Windows Server 2012 in an evironment with multiple domains: SERVER CLIENT-OLD CLIENT-NEW the application pool runs using a service account in the SERVER domain (lets say SEVER\WsSvc01). My WCF webservice…
user1859022
  • 2,585
  • 1
  • 21
  • 33
0
votes
1 answer

Want a PrincipalPermission SecurityException on REST service to return 403, not 400 Bad Request

I have a RESTful (WCF) service decorated with PrincipalPermission demands. I expected a 403 FORBIDDEN response if the user does not hold the role, but get a 400 BAD REQUEST, instead. Upon reflection, this makes sense - the demand triggers a…
James King
  • 6,233
  • 5
  • 42
  • 63
0
votes
2 answers

Request for principal permission failed - probably due windows group?

I googled for this error, didn't find correct answer.. 2 months ago I was doing MVC -> WCF communication. It worked, then I commented out PrincipalPermission attribute to get it working on localhost (VS IIS Express). After re-enable I receiving…
user1085907
  • 1,009
  • 2
  • 16
  • 40
0
votes
1 answer

ASP.Net website using forms authentication throws security exception on postback

I have used a custom role-based security with forms authentication for my ASP.net web application. The roles, users are fetched from sql server. The framework is targeted for version 4.0. I have used the code from…
0
votes
1 answer

IIS WebService Request for principal permission failed

I have created a simple web service and in the web service I have written a simple method as illustrated in the code below. [PrincipalPermission(SecurityAction.Demand, Role = @"KIANCOORP\SomethingElse Users U")] public string HelloWorld() { …
Kian Ting
  • 11
  • 4