Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Single sign-on Code Access Security for web parts

  Asked By: Sonny    Date: Jun 21    Category: Sharepoint    Views: 1016

I've created a web part which links to a databse and am retrieving credentials
from Sharepoints single sign-on service to connect to the database. This works
fine when I have full trust configured in web.config, but I would like to
configure Code Access Security so I am not using full trust. I have a custom
config file which is based on wss_minimaltrust.config. I have added the
permissions for SQLClient in here and that works fine for accessing data. I am
struggling to find the correct way of adding permissions for single sign-on, I
have added the following to the <SecurityClasses> section:<SecurityClass
ssion, Microsoft.SharePoint.Portal.SingleSignon.Security, Version=,
Culture=neutral, PublicKeyToken= 71e9bce111e9429c"/> and the following to the
named permissions section (under the SPrestricted named permission
set):<IPermission class="SingleSignonPermission" version="1" Access="Minimal" />
I have tried the different access levels of 'credentials' and 'administer' and
they don't work either. I get the following error from the web part:
ExceptionRequest for the permission of type
Microsoft.SharePoint.Portal.SingleSignon.Security, Version=,
Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.I'm guessing I'm adding
this in the wrong place or that there is something else I also need to add but I
can't seem to find any more information on this. I would be grateful for any



1 Answer Found

Answer #1    Answered By: Megan Martin     Answered On: Jun 21

It appears that one of the reasons could be version 11 is used and and it looks
to be demanding version 12. Here is the IPermission that I have used:

Microsoft.SharePoint.Portal.SingleSignon.Security, Version=,
Culture=neutral, PublicKeyToken=71e9bce111e9429c"

This is for MOSS 2007.

Didn't find what you were looking for? Find more on Single sign-on Code Access Security for web parts Or get search suggestion and latest updates.