Penautan Akun

Setiap integrasi Cloud-to-cloud harus menyertakan mekanisme untuk mengautentikasi pengguna.

Autentikasi memungkinkan Anda menautkan Akun Google pengguna dengan akun pengguna di sistem autentikasi Anda. Hal ini memungkinkan Anda mengidentifikasi pengguna saat pemenuhan Anda menerima intent smart home. Smart home Google hanya mendukung OAuth dengan alur kode otorisasi.

Setelah memiliki penerapan OAuth 2.0, Anda dapat secara opsional mengonfigurasi App Flip berbasis OAuth, yang memungkinkan pengguna Anda menautkan akun mereka di sistem autentikasi Anda ke Akun Google mereka dengan lebih cepat.

OAuth

Untuk smart home, Anda harus menggunakan OAuth dengan alur kode otorisasi, yang mengharuskan Anda memiliki dua endpoint: endpoint otorisasi dan penukaran token.

Setelah Anda mengautentikasi pengguna, token akses OAuth 2.0 pihak ketiga pengguna akan dikirim di header otorisasi saat maksud smart home dikirim ke pemenuhan Anda. Semua pengguna harus melakukan penautan akun, karena informasi perangkat dikirim ke Google Assistant dengan maksud action.devices.SYNC, yang memerlukan penautan akun.

Integrasi Cloud-to-cloud Anda diharapkan mendukung beberapa pengguna Google yang terhubung ke akun pengguna yang sama (misalnya, saat pengguna memberikan akses kepada pengguna lain di rumah mereka). Jika layanan Anda tidak dapat mendukung koneksi beberapa pengguna, layanan tersebut harus memberikan error pada saat penautan akun.

Untuk mengetahui petunjuk cara menyiapkan server OAuth 2.0 untuk integrasi Anda, lihat Menerapkan server OAuth 2.0 Anda.

Pengalihan Aplikasi berbasis 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.

Untuk mengetahui informasi selengkapnya tentang alur kode otorisasi penautan OAuth, lihat Menerapkan server OAuth 2.0.

Untuk mengetahui petunjuk cara mengonfigurasi App Flip untuk integrasi Anda, lihat App Flip berbasis OAuth.