การผสานรวม Cloud-to-cloud ทุกรายการต้องมีกลไกสำหรับ การตรวจสอบสิทธิ์ผู้ใช้
การตรวจสอบสิทธิ์ช่วยให้คุณลิงก์บัญชี Google ของผู้ใช้ กับบัญชีผู้ใช้ในระบบการตรวจสอบสิทธิ์ได้ ซึ่งจะช่วยให้คุณระบุผู้ใช้ได้เมื่อ การดำเนินการตามคำสั่งได้รับเจตนาของสมาร์ทโฮม สมาร์ทโฮมของ Google รองรับเฉพาะ OAuth ที่มี ขั้นตอนรหัสการให้สิทธิ์
เมื่อติดตั้งใช้งาน OAuth 2.0 แล้ว คุณจะกำหนดค่าApp Flip ที่อิงตาม OAuth ได้ ซึ่งจะช่วยให้ผู้ใช้ลิงก์บัญชีในระบบการตรวจสอบสิทธิ์กับบัญชี Google ได้เร็วขึ้น
OAuth
สำหรับ smart home คุณต้องใช้ OAuth กับขั้นตอนการใช้รหัสการให้สิทธิ์ ซึ่งกำหนดให้คุณต้องมีปลายทาง 2 รายการ ได้แก่ ปลายทางการให้สิทธิ์และการแลกเปลี่ยนโทเค็น
เมื่อคุณตรวจสอบสิทธิ์ผู้ใช้แล้ว ระบบจะส่งโทเค็นเพื่อการเข้าถึง OAuth 2.0 ของบุคคลที่สามของผู้ใช้ในส่วนหัวการให้สิทธิ์เมื่อมีการส่งเจตนา smart home
ไปยังการดำเนินการตามคำสั่ง ผู้ใช้ทุกคนต้องลิงก์บัญชี เนื่องจากระบบจะส่งข้อมูลอุปกรณ์ไปยัง Google Assistant พร้อมด้วยเจตนา action.devices.SYNC
ซึ่งต้องมีการลิงก์บัญชี
Cloud-to-cloudการผสานรวมของคุณควรจะรองรับผู้ใช้ Google หลายรายที่เชื่อมต่อกับบัญชีผู้ใช้เดียวกัน (เช่น เมื่อผู้ใช้ให้สิทธิ์เข้าถึงแก่ผู้ใช้รายอื่นในครัวเรือน) หากบริการของคุณไม่รองรับการเชื่อมต่อของผู้ใช้หลายคน บริการควรแสดงข้อผิดพลาดเมื่อลิงก์บัญชี
ดูวิธีการตั้งค่าเซิร์ฟเวอร์ OAuth 2.0 สำหรับการผสานรวมได้ที่ ใช้เซิร์ฟเวอร์ OAuth 2.0
App Flip ที่ใช้ OAuth
OAuth-based App Flip Linking (App Flip) allows your users to easily and quickly link their accounts in your authentication system to their Google accounts. If your app is installed on your user’s phone when they initiate the account linking process, they are seamlessly flipped to your app to obtain user authorization.
This approach provides a faster and easier linking process since the user does not have to re-enter their username and password to authenticate; instead, App Flip leverages the credentials from the user's account on your app. Once a user has linked their Google account with your app, they can take advantage of any integrations that you have developed.
You can set up App Flip for both iOS and Android apps.
Requirements
To implement App Flip, you must fulfill the following requirements:
- You must have an Android or iOS app.
- You must own, manage and maintain an OAuth 2.0 server which supports the OAuth 2.0 authorization code flow.
ดูข้อมูลเพิ่มเติมเกี่ยวกับขั้นตอนรหัสการให้สิทธิ์การลิงก์ OAuth ได้ที่ใช้เซิร์ฟเวอร์ OAuth 2.0
ดูวิธีการกำหนดค่า App Flip สำหรับการผสานรวมได้ที่App Flip ที่อิงตาม OAuth