Procedura: Configurazione dei servizi di origine per la protezione anonima del dialogo (Transact-SQL)
SQL Server utilizza la protezione del dialogo per le conversazioni con un servizio per il quale esiste un'associazione al servizio remoto. Se il database che ospita il servizio di destinazione non contiene un utente corrispondente all'utente che ha creato il dialogo, per il dialogo viene utilizzata la protezione anonima.
![]() |
---|
Installare i certificati solo da fonti attendibili. |
Per verificare l'utilizzo della protezione del dialogo da parte del servizio di origine
Ottenere un certificato per un utente del database remoto da una fonte attendibile.
Creare un utente senza un account di accesso.
Installare il certificato per il servizio remoto. L'utente creato nel passaggio 3 è il proprietario del certificato. Per impostazione predefinita, il certificato è attivo per BEGIN DIALOG.
Creare un'associazione al servizio remoto con l'indicazione dell'utente e del servizio di destinazione. Per la protezione del dialogo anonima l'impostazione ANONYMOUS dell'associazione al servizio remoto corrisponde a ON.
Esempio
In questo esempio viene configurata la protezione del dialogo anonima per le conversazioni tra il servizio denominato OrderParts nell'istanza corrente e il servizio denominato SupplierOrders nell'istanza remota.
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
Vedere anche
Attività
Procedura: Configurazione di autorizzazioni per un servizio locale (Transact-SQL)
Altre risorse
CREATE CERTIFICATE (Transact-SQL)
CREATE USER (Transact-SQL)
CREATE REMOTE SERVICE BINDING (Transact-SQL)
OPEN MASTER KEY (Transact-SQL)
CLOSE MASTER KEY (Transact-SQL)