Permissions for access to Active Directory (CAS)

T

Taras Overchuk

Hi!
I need to access to Active Directory from Web Servise by DirectoryServices,
but at runtime I had SecurityException with message:
System.Security.SecurityException: Security error.
at PartnerData.DQuery.SplitUser()
at PartnerData.DQuery.get_CompanyName() in
d:\virtualdirs\webservices\partnerdata\dquery.asmx.cs:line 92
at PartnerData.DQuery.GetTestInfo() in
d:\virtualdirs\webservices\partnerdata\dquery.asmx.cs:line 172

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.EnvironmentPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Read="TEMP;TMP;USERNAME;OS;COMPUTERNAME"/>
<IPermission class="System.Security.Permissions.FileIOPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Read="D:\VirtualDirs\WebServices\PartnerData"
Write="D:\VirtualDirs\WebServices\PartnerData"
Append="D:\VirtualDirs\WebServices\PartnerData"
PathDiscovery="D:\VirtualDirs\WebServices\PartnerData"/>
<IPermission
class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Allowed="AssemblyIsolationByUser"
UserQuota="9223372036854775807"/>
<IPermission class="System.Security.Permissions.SecurityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Assertion, Execution, ControlThread,
ControlPrincipal, RemotingConfiguration"/>
<IPermission class="System.Web.AspNetHostingPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Level="Medium"/>
<IPermission class="System.Net.DnsPermission, System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Drawing.Printing.PrintingPermission,
System.Drawing, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Level="DefaultPrinting"/>
<IPermission class="Microsoft.SharePoint.Security.SharePointPermission,
Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
version="1"
ObjectModel="True"/>
<IPermission class="System.Data.SqlClient.SqlClientPermission,
System.Data, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="Microsoft.SharePoint.Security.WebPartPermission,
Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c"
version="1"
Connections="True"/>
<IPermission class="System.Net.WebPermission, System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission
class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"

PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000
100F901577EEB3062D31C3E893B2BCADBEF1FDA50A8978E998CC6374D53D0C1D00DBF2B75E1D
894837E07EE27A38ADF39B0AD6A15056DD118A4E80DE9E8D57FF87B0ACC4507FA1E9EA702F2F
9C944A1DD14399CBC29156D18C4CA349D2AE9ED6392C523DEE546D8D382F372396CB1605B2D7
FE5E790D71C8EEB6337E93C5208CCB4"
Name="PartnerData"
AssemblyVersion="1.0.2.0"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"

Url="file://D:/VirtualDirs/WebServices/PartnerData/bin/PartnerData.DLL"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Zone="MyComputer"/>
</PermissionSet>

What kind of Permissions I have to give for my application in this case.P.S.
If I give "Full" trust level than my application work perfect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top