すべての smart home アクションには、ユーザーを認証するメカニズムが含まれている必要があります。
認証を使用すると、ユーザーの Google アカウントを認証システムのユーザー アカウントにリンクできます。これにより、フルフィルメントがスマートホーム インテントを受信したときにユーザーを識別できます。Google スマートホームは、認証コードフローを使用した OAuth のみをサポートしています。
OAuth 2.0 を実装すると、OAuth ベースの App Flip を必要に応じて設定できるようになります。これにより、デベロッパーの認証システムに登録されているユーザーのアカウントを、そのユーザーの Google アカウントに簡単にリンクできます。
OAuth
smart home では、認証コードフローで OAuth を使用する必要があります。これには、認証エンドポイントとトークン交換エンドポイントの 2 つのエンドポイントが必要です。
ユーザーを認証すると、smart home インテントがフルフィルメントに送信されると、ユーザーのサードパーティの OAuth 2.0 アクセス トークンが認証ヘッダーで送信されます。デバイス情報は、アカウントのリンクを必要とする action.devices.SYNC
インテントで Google Assistant に送信されるため、すべてのユーザーがアカウント リンクを実行する必要があります。
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.

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 をご覧ください。