步骤 7(可选):使用单一登录连接 AdventureWorks2000 数据库

业务数据目录支持使用单一登录 (SSO) 以连接到后端业务线 (LOB) 系统。传递身份验证具有其自身的缺点。有关详细信息,请参阅业务数据目录身份验证。因此,如果您的数据库使用 Windows 或数据库身份验证并且您的 Web 服务系统使用 Windows 或其他凭据,则建议您使用 SSO。

业务数据目录身份验证主题中所述,您可以将三种身份验证模式用于 SSO:

  • WindowsCredentials(数据库和 Web 服务系统)

    Microsoft Office SharePoint Server 2007 通过使用 Microsoft Windows 凭据从它的默认单一登录 (SSO) 服务进行身份验证。如果数据库服务器或 Web 服务使用 Windows 身份验证,则使用这种模式。您需要为这种模式设置 SSO。

  • RdbCredentials(仅数据库系统)

    在 RdbCredentials 模式下,Office SharePoint Server 2007 通过使用其默认 SSO 服务中的数据库凭据来进行身份验证。Office SharePoint Server 2007 将数据库凭据添加到连接字符串并将凭据传送到数据库服务器。如果数据库服务器使用数据库凭据,则使用这种模式。例如,如果 SQL Server 使用 SQL Server 身份验证而不是 Windows 身份验证。您需要为这种模式设置 SSO。

  • Credentials(仅 Web 服务系统)

    Office SharePoint Server 2007 通过使用其默认 SSO 服务中除 Windows 身份验证凭据之外的其他凭据对 Web 服务系统进行身份验证。这些凭据用于基本或摘要式身份验证,具体取决于 Web 服务服务器的配置。因为基本和摘要式身份验证没有为凭据提供充分保护,所以您应该使用 SSL 或 IPSec 或两者以保护 Web 服务服务器与运行业务数据目录的服务器之间的通信。如果您的 Web 服务使用除 Windows 凭据之外的其他凭据,则使用这种模式。您需要为这种模式设置 SSO。

当连接到 AdventureWorks2000 数据库时,要使用 SSO 而不使用传递身份验证,请使用下面的过程。请注意,在这种情况下,SQL Server 必须设置为使用 Windows 身份验证。

先决条件

步骤 2:定义实体、方法和筛选器

或者

步骤 3(可选):定义操作

或者

步骤 4(可选):定义关联

或者

步骤 5(可选):定义 IDEnumerator 方法和启用业务数据搜索

步骤 6(可选):指定访问权限

使用单一登录连接到数据库

  1. 通过步骤 2、3、4 或 5 打开 AdventureWorks.XML 文件。

  2. 将现有 <LobSystemInstance> 标记替换为以下 XML:

    <LobSystemInstance Name="AdventureWorksSampleInstance">
          <!-- Business Data clients such as the Web Parts and List use 
          the Instance name in the entity picker, etc.-->
           <Properties>
            <Property Name="AuthenticationMode" Type="System.String">WindowsCredentials</Property>
            <!--AuthenticationMode can be set to PassThrough, 
            RevertToSelf, RdbCredentials, or WindowsCredentials. -->
            <Property Name="DatabaseAccessProvider" Type="System.String">SqlServer</Property>
            <!-- Can be SQL Server, OLEDB, Oracle, or ODBC for 
            database systems. -->
            <Property Name="RdbConnection Data Source" Type="System.String">EnterYourAdventureWorks2000ServerNameHere</Property>
            <!-- The name of your server hosting the AdventureWorks2000 
            database or the name of the SQL Server instance in the 
            format SQLServer\Instance. -->
            <Property Name="RdbConnection Initial Catalog" Type="System.String">AdventureWorks2000</Property>
            <!-- The name of the database.> -->
            <Property Name="RdbConnection Integrated Security" Type="System.String">SSPI</Property>
            <Property Name="RdbConnection Pooling" Type="System.String">false</Property>
             <Property Name="SsoApplicationId" Type="System.String">AdventureWorks2000</Property>
             <Property Name ="SsoProviderImplementation" Type="System.String">Microsoft.SharePoint.Portal.SingleSignon.SpsSsoProvider, Microsoft.SharePoint.Portal.SingleSignon, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Property>      
          </Properties>
        </LobSystemInstance>
    
  3. 在 LobSystemInstance 元数据中,在 Rdb Connection Source 属性中相应地替换承载 AdventureWorks2000 数据库的 SQL Server 计算机的名称。如果您使用 SQL Server 实例,则使用格式 SQLServer\Instance。

  4. 保存 XML。

  5. 配置单一登录。如果是首次配置单一登录,则完成以下任务:

    1. 确定并设置必需的 Microsoft Windows 帐户。

    2. 在作业服务器上启用单一登录服务。

    3. 配置单一登录设置。

    4. 创建应用程序定义。名称应该与在元数据中定义的 SSOApplicationId 属性相匹配。

    5. 为应用程序定义提供帐户信息。

    6. 在前端服务器上启用单一登录服务。

  6. 在再次添加应用程序定义之前,必须从业务数据目录中删除您在步骤 1 中创建的 AdventureWorksSample 应用程序。要删除 AdventureWorksSample,请按照下列步骤操作:

    1. 打开“SharePoint 3.0 管理中心”。

    2. 在左侧导航窗格中,单击您的“共享服务提供程序 (SSP)”的名称。

    3. 在“业务数据目录”部分,单击“查看应用程序”以查看已注册的应用程序。

    4. 单击 AdventureWorksSample 以打开“查看应用程序:AdventureWorksSample”页。

    5. 最后,单击“应用程序设置”部分中的“删除应用程序”。

  7. 现在,将应用程序定义添加到业务数据目录中。有关详细信息,请参阅如何:将应用程序定义添加到业务数据目录

  8. 通过使用业务数据功能从 AdventureWorks2000 数据库中显示数据来测试元数据。有关详细信息,请参阅测试元数据

See Also

任务

AdventureWorks SQL Server 2000 示例

概念

业务数据目录:元数据模型