16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 26: Single Sign-On in SharePoint Portal Server 2003 717<br />

to specify it. For example, you would pass the specified port when the system<br />

cannot detect which SSL port to use, such as when multiple SSL port mappings<br />

exist. The required assembly for this class is <strong>Microsoft</strong>.SharePoint.Portal,<br />

located in <strong>Microsoft</strong>.SharePoint.Portal.dll.<br />

Table 26-1 <strong>Microsoft</strong>.SharePoint.Portal.SingleSignOn Namespace Core Classes<br />

Class Description<br />

Application Exposes functionality to add, get, <strong>and</strong> delete enterprise<br />

application definitions<br />

Credentials Exposes functionality to manage user <strong>and</strong> group credentials<br />

<strong>and</strong> access tokens<br />

SSOReturnCodes Contains all the return codes for SSOSrv service that the<br />

SingleSignonException class will throw<br />

SingleSignonException Instantiates an exception from the SSOSrv service with a<br />

specific error code<br />

Table 26-2 <strong>Microsoft</strong>.SharePoint.Portal.SingleSignOn Security Namespace Classes<br />

Class Description<br />

SingleSignOnPermission Allows security actions for SingleSignOnPermission to be<br />

applied to code using declarative security.<br />

SingleSignOnPermissionAttribute Represents a custom permission that controls the ability<br />

to access <strong>Microsoft</strong> SharePoint <strong>Products</strong> <strong>and</strong> <strong>Technologies</strong><br />

resources to manage user <strong>and</strong> group credentials <strong>and</strong><br />

access tokens.<br />

For example, let’s look into a code in the Web Part that retrieves the account<br />

credentials for a back-end enterprise application from the single sign-on credentials<br />

database. The corresponding application definition is configured to use individual<br />

accounts. The code checks whether a requesting user’s credentials have already<br />

been stored in the single sign-on credential database. If not, the user is redirected to<br />

the Single Sign-On logon form to enter the required credentials for accessing the<br />

back-end application.<br />

The code should implement the following sequence:<br />

1. Call the GetCredentials method of the Credentials class. Specify the application<br />

name for which the credentials need to be retrieved from the single sign-on<br />

database.<br />

2. If the SSOSrv service cannot find credentials for the user for the enterprise application<br />

specified, the GetCredentials method throws a SingleSignonException.<br />

If the LastErrorCode property of the SingleSignonException is SSO_E_CREDS_<br />

NOT_FOUND, call the GetCredentialEntryUrl(String) method—or the Get-<br />

CredentialEntryUrl(String, Int) method—of the SingleSignonLocator class to build<br />

the URL to the single sign-on logon form.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!