Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows Server

การกำหนดค่า SSO (Single Sign-On) Authentication บน Windows Server RDS

บทนำ

Single Sign-On (SSO) เป็นเทคโนโลยีที่ช่วยให้ User ที่ผ่าน Authentication (Signed On) แล้ว เข้าถึง Domain Services อื่นๆ ได้โดยไม่ต้อง Authenticate ซ้ำ นำไปใช้กับ Remote Desktop Service SSO ช่วยให้ User ที่ Login เข้าสู่ Domain Computer ไม่ต้องกรอก Credentials (Username และ Password) ซ้ำเมื่อเชื่อมต่อ RDS Servers หรือ Launch Published RemoteApps

บทความนี้อธิบายรายละเอียดการตั้งค่า Transparent SSO Authentication บน RDS Servers ที่รัน Windows Server 2016 และ 2012 R2

System Requirements

  • Connection Broker Server และ RDS Servers ทั้งหมดต้องรัน Windows Server 2012 หรือใหม่กว่า
  • SSO ทำงานได้เฉพาะใน Domain Environment: ต้องใช้ AD User Accounts, RDS Servers และ Workstations ของ User ต้องอยู่ใน AD Domain
  • RDP 8.0 หรือใหม่กว่าต้องใช้บน RDP Clients (ไม่สามารถติดตั้ง RDP Client รุ่นนี้บน Windows XP ได้)
  • OS Versions ที่รองรับฝั่ง Client: Windows 10, 8.1 หรือ 7
  • SSO ทำงานได้เฉพาะ Password Authentication (Smart Cards ไม่รองรับ)
  • RDP Security Layer ใน Connection Settings ต้องตั้งเป็น Negotiate หรือ SSL (TLS 1.0) และ Encryption Mode เป็น High หรือ FIPS Compliant

ขั้นตอนการตั้งค่า Single Sign-On

  • ต้อง Issue และ Assign SSL Certificate บน RD Gateway, RD Web, และ RD Connection Broker Servers
  • Enable Web SSO บน RDWeb Server
  • ตั้งค่า Group Policy สำหรับ Credentials Delegation
  • เพิ่ม Certificate Thumbprint เข้า Trusted .rdp Publishers ผ่าน GPO

1. ออกและกำหนด SSL Certificate

ใน EKU (Enhanced Key Usage) ของ Certificate ต้องมี Identifier Server Authentication ไว้ด้วย (ขั้นตอนการขอ SSL Certificate ไม่ได้อธิบายเพราะเกินขอบเขต บทความนี้ สามารถสร้าง Self-signed SSL Certificate เองได้ แต่ต้อง Deploy ไป Trusted Cert บน Clients ทั้งหมดผ่าน GPO)

กำหนด Certificate ใน Section Certificates ของ RDS Deployment Properties

2. Enable Windows Authentication บน RDWeb

Enable Windows Authentication บนทุก Server ที่มี Web Access Role สำหรับ IIS RDWeb Directory และ Disable Anonymous Authentication

หลังบันทึกเปลี่ยนแปลง Restart IIS:

iisreset /noforce

หากใช้ RD Gateway ตรวจสอบว่าไม่ได้ใช้สำหรับ Internal Clients (Option Bypass RD Gateway server for local address ต้อง Check)

3. Credentials Delegation Policy

สร้าง Domain GPO ใหม่ Link ไป OU ที่มี Users (Computers) ที่ต้องการให้ SSO เข้าถึง RDS Server หากต้องการ SSO สำหรับ User ทั้ง Domain แก้ Default Domain Policy ก็ได้

Policy อยู่ที่: Computer Configuration → Policies → Administrative Templates → System → Credential Delegation → Allow delegation defaults credential Policy นี้อนุญาตให้เซิร์ฟเวอร์บางตัวเข้าถึง Credentials ของ Windows Users:

  • Enable Policy (Enabled)
  • เพิ่มชื่อ RDS Servers ในรายการ Servers ที่ Client สามารถส่ง User Credentials ไปทำ SSO Authentication ได้อัตโนมัติ Format: TERMSRV/rd.contoso.com (ตัวอักษร TERMSRV ต้องเป็น Upper Case ทั้งหมด) หากต้องการให้สิทธิ์ Terminal Servers ทั้งหมดใน Domain (น้อยกว่า Secure) ใช้: TERMSRV/*.contoso.com

4. Trusted RDP Publishers

เพื่อป้องกัน Warning ว่า Remote App Publisher ไม่ Trusted ให้เพิ่ม Address ของ Server ที่มี Connection Broker Role เข้า Trusted Zone บน Client Computers ด้วย Policy Site to Zone Assignment List (คล้ายบทความ How to disable Open File security warning on Windows 10): User/Computer Configuration → Administrative Tools → Windows Components → Internet Explorer → Internet Control Panel → Security Page

ระบุ FQDN Server Name RDCB และ Zone 2 (Trusted Sites)

จากนั้น Enable Logon options Policy ใน User/Computer Configuration → Administrative Tools → Windows Components → Internet Explorer → Internet Control Panel → Security → Trusted Sites Zone และใน Dropdown เลือก Automatic logon with current username and password

หลัง Update Group Policies บน Client หากลอง Start RemoteApp จะไม่มี Password Prompt แต่จะมี Warning Window:

Do you trust the publisher of this RemoteApp program?

เพื่อป้องกันข้อความนี้แสดงทุกครั้งตอน Logon ต้องเอา SSL Certificate Thumbprint บน RD Connection Broker มาเพิ่มใน Trusted RDP Publishers List รัน PowerShell บน RDS Connection Broker Server:

Get-Childitem CERT:\LocalMachine\My

Copy ค่า Thumbprint ไปเพิ่มใน Policy Specify SHA1 thumbprints of certificates representing RDP publishers (Computer Configuration → Administrative Templates → Windows Desktop Services → Remote Desktop Connection Client)

ผลลัพธ์

ตอนนี้การตั้งค่า SSO เสร็จสิ้น หลัง Policies ถูก Apply User สามารถเชื่อมต่อ Windows Server RDS Farm ผ่าน RDP ได้โดยไม่ต้องกรอก Password ซ้ำ

ตอนเปิด mstsc.exe (Remote Desktop Client) ระบุชื่อ RDS Server Field UserName จะแสดง Username อัตโนมัติในรูปแบบ (user@domain.com) พร้อม Caption:

Your Windows logon credentials will be used to connect.

RD Gateway กับ SSO

เพื่อใช้ RD Gateway กับ SSO ต้อง Enable Policy Set RD Gateway Authentication Method (User Configuration → Policies → Administrative Templates → Windows Components → Remote Desktop Services → RD Gateway) ตั้งค่าเป็น Use Locally Logged-On Credentials

Web SSO บน RD Web Access

ข้อควรทราบ: แนะนำให้ใช้ Internet Explorer พร้อม Active X Component ชื่อ Microsoft Remote Desktop Services Web Access Control (MsRdpClientShell) เปิดใช้งาน