Home All Groups Group Topic Archive Search About

PrincipalPermission.Demand() returns: Request for principal permission failed

Author
7 Mar 2005 7:16 PM
Dan Woodring via .NET 247
I'm having a PrincipalPermission problem.  Here's what I've done:
1) In IIS directory security, I've disabled Anonymous access and enabled Integrated Windows Authentication.
2) Created a local windows group called "TESTERS"
3) Created a local windows user called "TESTUSER"
4) I run the following code:
   Dim sDomain_User as string = "MyLocalMachine\TESTUSER"
   Dim sAuthGroup as string = "MyLocalMachine\TESTERS"
   Dim oPrincipalPerm1 As New PrincipalPermission(sDomain_User, sAuthGroup)
   oPrincipalPerm1.Demand()

The exception: Request for principal permission failed is returned.   Can anybody Help?

If anybody can help I'd really appreciate it!
--------------------------------
From: Dan Woodring

--------------------------------
From: Dan Woodring

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Tj9/hzg5DUiRE0AuPCEMkg==</Id>

Author
8 Mar 2005 4:01 AM
Joe Kaplan (MVP - ADSI)
What does Thread.CurrentPrincipal.Identity.Name say and what do you get with
Thread.CurrentPrincipal.IsInRole("mylocalmachine\TESTERS")?

That should probably work as long as that user was actually authenticated,
but checking the above things will help troubleshoot.

HTH,

Joe K.

Show quoteHide quote
"Dan Woodring via .NET 247" <anonym***@dotnet247.com> wrote in message
news:uDzFho0IFHA.720@TK2MSFTNGP10.phx.gbl...
> I'm having a PrincipalPermission problem.  Here's what I've done:
> 1) In IIS directory security, I've disabled Anonymous access and enabled
> Integrated Windows Authentication.
> 2) Created a local windows group called "TESTERS"
> 3) Created a local windows user called "TESTUSER"
> 4) I run the following code:
>   Dim sDomain_User as string = "MyLocalMachine\TESTUSER"
>   Dim sAuthGroup as string = "MyLocalMachine\TESTERS"
>   Dim oPrincipalPerm1 As New PrincipalPermission(sDomain_User, sAuthGroup)
>   oPrincipalPerm1.Demand()
>
> The exception: Request for principal permission failed is returned.   Can
> anybody Help?
>
> If anybody can help I'd really appreciate it!
> --------------------------------
> From: Dan Woodring
>
> --------------------------------
> From: Dan Woodring
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
>
> <Id>Tj9/hzg5DUiRE0AuPCEMkg==</Id>