ربط الحساب

يجب أن يتضمّن كل تكامل مع Cloud-to-cloud آلية لمصادقة المستخدمين.

تتيح لك المصادقة ربط حسابات المستخدمين على Google بحسابات المستخدمين في نظام المصادقة. يتيح لك ذلك تحديد المستخدمين عندما يتلقّى التنفيذ طلبًا من جهاز منزلي ذكي. لا تتوافق ميزة "المنزل الذكي من Google" إلا مع بروتوكول OAuth الذي يتضمّن مسار رمز المصادقة.

بعد إعداد OAuth 2.0، يمكنك اختياريًا ضبط App Flip المستند إلى OAuth، ما يتيح للمستخدمين ربط حساباتهم في نظام المصادقة الخاص بك بحساباتهم على Google بشكل أسرع.

OAuth

بالنسبة إلى smart home، عليك استخدام OAuth مع مسار رمز التفويض، ما يتطلب توفُّر نقطتَي نهاية: التفويض وتبادل الرموز المميزة.

بعد مصادقة المستخدم، يتم إرسال رمز الدخول الخاص به إلى OAuth 2.0 التابع لجهة خارجية في عنوان التفويض عند إرسال smart homeطلبات إلى خدمة التنفيذ. على جميع المستخدمين ربط حساباتهم، لأنّه يتم إرسال معلومات الجهاز إلى Google Assistant باستخدام الغرض action.devices.SYNC، ما يتطلّب ربط الحساب.

من المتوقّع أن يتيح تكامل Cloud-to-cloud ربط عدة مستخدمين على 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 لعملية الدمج، يُرجى الاطّلاع على App Flip المستند إلى بروتوكول OAuth.