次の方法で共有


匿名ダイアログ セキュリティのために発信側サービスを構成する方法 (Transact-SQL)

SQL Server では、リモート サービス バインドが存在するサービスとの任意のメッセージ交換に、ダイアログ セキュリティが使用されます。対象サービスをホストするデータベースに、ダイアログを作成したユーザーと対応するユーザーが含まれていない場合、そのダイアログでは匿名セキュリティが使用されます。

セキュリティに関する注意セキュリティに関する注意

信頼できる発行元の証明書以外はインストールしないでください。

発信側サービスでダイアログ セキュリティが使用されるようにするには

  1. 信頼できる発行元からリモート データベース内のユーザーの証明書を取得します。

  2. ログインのないユーザーを作成します。

  3. リモート サービスの証明書をインストールします。手順 3. で作成したユーザーがこの証明書を所有します。既定では、証明書は BEGIN DIALOG に対してアクティブになります。

  4. 作成したユーザーと対象サービスを指定するリモート サービス バインドを作成します。匿名ダイアログ セキュリティの場合は、リモート サービス バインドで ANONYMOUS = ON を指定します。

使用例

この例では、匿名ダイアログ セキュリティを構成し、現在のインスタンスの OrderParts サービスとリモート インスタンスの SupplierOrders サービスの間でメッセージを交換できるようにします。

USE AdventureWorks2008R2 ;
GO

-- Given a certificate for a remote user for the remote service
-- SupplierOrders, create a remote service binding for
-- the service.  The remote user will be granted permission
-- to send messages to the local service OrderParts. 
-- This example assumes that the certificate for the service 
-- is saved in the file'C:\Certificates\SupplierOrders.cer' and that
-- the initiating service already exists.


-- Create a user without a login.

CREATE USER [SupplierOrdersUser]
    WITHOUT LOGIN ;
GO

-- Install a certificate for the owner of the service
-- in the remote database. The certificate is
-- provided by the owner of the remote service. The
-- user for the remote service owns the certificate.

CREATE CERTIFICATE [SupplierOrdersCertificate]
    AUTHORIZATION [SupplierOrdersUser]
    FROM FILE='C:\Certificates\SupplierOrders.cer' ;
GO

-- Create the remote service binding. Notice
-- that the user specified in the binding
-- does not own the binding itself.

-- Creating this binding specifies that messages from
-- this database are secured using the certificate for
-- the [SupplierOrdersUser] user.

-- Since anonymous is ON, the credentials for the user
-- that begins the conversation are not used for the
-- conversation.

CREATE REMOTE SERVICE BINDING [SupplierOrdersBinding]
    TO SERVICE 'SupplierOrders'
    WITH USER = [SupplierOrdersUser],
         ANONYMOUS = ON ;
GO