ยินดีต้อนรับสู่ศูนย์นักพัฒนาซอฟต์แวร์ Google Home ซึ่งเป็นจุดหมายใหม่เกี่ยวกับวิธีพัฒนาการดําเนินการสําหรับบ้านอัจฉริยะ หมายเหตุ: คุณจะสร้างการดําเนินการต่างๆ ต่อไปในคอนโซลการดําเนินการ

การลิงก์บัญชี

ทุกsmart homeการดําเนินการต้องมีกลไกในการตรวจสอบสิทธิ์ผู้ใช้

การตรวจสอบสิทธิ์ช่วยให้คุณลิงก์บัญชี Google ของผู้ใช้เข้ากับบัญชีผู้ใช้ในระบบการตรวจสอบสิทธิ์ ซึ่งจะช่วยให้คุณระบุผู้ใช้ได้เมื่อดําเนินการตามคําสั่งซื้อบ้านสําเร็จ สมาร์ทโฮมของ Google รองรับเฉพาะ OAuth ด้วยขั้นตอนการให้สิทธิ์รหัสการให้สิทธิ์

เมื่อติดตั้ง OAuth 2.0 แล้ว คุณจะเลือกกําหนดค่าApp Flip แบบ OAuth ได้ ซึ่งจะช่วยให้ผู้ใช้ลิงก์บัญชีในระบบการตรวจสอบสิทธิ์กับบัญชี Google ได้รวดเร็วขึ้น

OAuth

สําหรับ smart home คุณต้องใช้ OAuth ที่มีขั้นตอนการให้สิทธิ์รหัสการให้สิทธิ์ ซึ่งต้องมีปลายทาง 2 จุด ได้แก่ ปลายทางการให้สิทธิ์และการแลกเปลี่ยนโทเค็น

เมื่อตรวจสอบสิทธิ์ผู้ใช้แล้ว ระบบจะส่งโทเค็นการเข้าถึง OAuth 2.0 ของบุคคลที่สามในส่วนหัวการให้สิทธิ์เมื่อมีการส่ง Intent ของ smart home ไปยัง Fulfillment ผู้ใช้ทุกคนต้องลิงก์บัญชี เนื่องจากระบบจะส่งข้อมูลอุปกรณ์ไปยัง Google Assistant โดยมีเจตนา action.devices.SYNC ซึ่งต้องใช้การลิงก์บัญชี

การดําเนินการ smart home ควรสนับสนุนผู้ใช้ Google หลายคนที่เชื่อมต่อกับบัญชีผู้ใช้เดียวกัน (เช่น เมื่อผู้ใช้ให้สิทธิ์เข้าถึงแก่ผู้ใช้รายอื่นในครอบครัว) หากบริการของคุณไม่สามารถรองรับการเชื่อมต่อหลายผู้ใช้ บริการควรแสดงข้อผิดพลาดขณะลิงก์บัญชี

สําหรับคําแนะนําเกี่ยวกับวิธีตั้งค่าเซิร์ฟเวอร์ OAuth 2.0 สําหรับการดําเนินการของคุณ โปรดดูใช้เซิร์ฟเวอร์ OAuth 2.0 ของคุณ

การพลิกแอปโดยใช้ 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.

This figure shows the steps for a user to link their Google account
            to your authentication system. The first screenshot shows how a user
            can select your app if their Google account is linked to your app.
            The second screenshot shows the confirmation for linking their
            Google account with your app. The third screenshot shows a
            successfully linked user account in the Google app.
Figure 1. Account linking on a user's phone with App Flip.

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 สําหรับการดําเนินการของคุณ โปรดดูแบบ OAuth App Flip