Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Berlaku untuk: SQL Server
Azure SQL Managed Instance
SQL Server menggunakan keamanan dialog untuk percakapan apa pun ke layanan tempat pengikatan layanan jarak jauh ada. Jika database yang menghosting layanan target tidak berisi pengguna yang sesuai dengan pengguna yang membuat dialog, dialog menggunakan keamanan anonim.
Catatan
Hanya instal sertifikat dari sumber tepercaya.
Untuk memastikan bahwa layanan yang memulai menggunakan keamanan dialog
Dapatkan sertifikat untuk pengguna di database jarak jauh dari sumber tepercaya.
Membuat pengguna tanpa login.
Instal sertifikat untuk layanan jarak jauh. Pengguna yang dibuat di langkah 3 memiliki sertifikat. Secara default sertifikat aktif untuk BEGIN DIALOG.
Buat pengikatan layanan jarak jauh yang menentukan pengguna dan layanan target. Untuk keamanan dialog anonim, pengikatan layanan jarak jauh menentukan ANONIM = AKTIF.
Contoh
Contoh ini mengonfigurasi keamanan dialog anonim untuk percakapan antara layanan bernama OrderParts dalam instans saat ini dan layanan bernama SupplierOrders dalam instans jarak jauh.
Catatan
Sampel kode dalam artikel ini diuji menggunakan database sampel AdventureWorks2022
, yang dapat Anda unduh dari Sampel Microsoft SQL Server dan Proyek Komunitas beranda.
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