Udostępnij za pośrednictwem


Jak Konfigurowanie inicjowanie usług dla anonimowego okno dialogowe zabezpieczeń (języka Transact-SQL)

SQL Server używa okna dialogowego zabezpieczeń konwersacji do usługa, dla których istnieje wiązanie usługi zdalnej.Jeśli obsługującego usługa miejsce docelowe bazy danych nie zawiera użytkownika, który odpowiada użytkownika, który utworzył okno dialogowe, okno dialogowe używa anonimowe zabezpieczeń.

Security noteSecurity Note:

Certyfikatów należy instalować tylko z zaufanych źródeł.

Aby upewnić się, że usługa inicjujący używa okna dialogowego zabezpieczeń

  1. Uzyskaj certyfikat użytkownika w zdalnej bazie danych z zaufanego urządzenie źródłowe.

  2. Utwórz użytkownika bez identyfikatora logowania.

  3. Zainstaluj certyfikat dla usługa zdalnego.Certyfikat należące do użytkownika, utworzony w kroku 3.Domyślnie certyfikat jest aktywny dla instrukcji BEGIN DIALOG.

  4. Utwórz wiązanie usługi zdalnej, które określa użytkownika i usługa miejsce docelowe.Anonimowy okno dialogowe zabezpieczeń, wiązanie usługi zdalnej określa ANONYMOUS = ON.

Example

W tym przykładzie konfiguruje anonimowy w oknie dialogowym Zabezpieczenia dla konwersacji między usługa o nazwie OrderParts w bieżącej instancji i usługa o nazwie SupplierOrders zdalnego wystąpienie.

USE AdventureWorks ;
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