[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

PrincipalPermissionAttribute Bug?

Dean Bates

1/14/2003 11:01:00 PM

To reproduce create a standard Hello world template c# web
service in VS.NET.

Add using System.Security.Permissions to libraries.
Uncomment hello world example adding
[PrincipalPermissionAttribute(SecurityAction.Demand,
Authenticated=true, Name=@"DEAN")] under [WebMethod].

Use IIS to setup HTTP Authentication on web service.

Logon to web service through IE using account in
PrincipalPermissionAttribute (eg DEAN), select Helloworld
webmethod. Page not found is returned. Web service works
without PrincipalPermissionAttribute.

I've also tried Name=@"DOMAIN\DEAN"




1 Answer

(garygumsft)

1/15/2003 9:24:00 AM

0

Hi,

Since the method in the web serviced was configured that the request should
run under the DOMAIN\DEAN account, there three things that you should check:
1. The Name attribute of the PrincipalPermissionAttribute should be
@"DOMAIN\DEAN" instead of "DEAN"
2. The Directory Security on the virtual directory where the web service
was located in should be configured to "Basic authentication" or
"Integrated Windows authentication" and the "Anonymous access" option
should be unchecked.
3. The mode attribute of the authentication section in the web.config file
should be set to "Windows". By default, it was set to "None", which causes
the IIS token won't be passed to the ASP.NET worker process. In this case,
the web service will run under the ASP.NET worker process account (ASPNET).
The demand on the ASPNET account should fail.

<authentication mode="Windows" />

Gary

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://w...