계정 연결

모든 smart home 작업에는 사용자 인증 메커니즘이 포함되어야 합니다.

인증을 사용하면 사용자의 Google 계정을 인증 시스템의 사용자 계정과 연결할 수 있습니다. 이를 통해 처리가 스마트 홈 인텐트를 수신할 때 사용자를 식별할 수 있습니다. Google 스마트 홈은 승인 코드 흐름에서만 OAuth를 지원합니다.

OAuth 2.0을 구현하면 사용자가 인증 시스템의 계정을 Google 계정에 더 빠르게 연결할 수 있도록 선택적으로 OAuth 기반 App Flip을 구성할 수 있습니다.

OAuth

smart home의 경우 OAuth를 승인 코드 흐름과 함께 사용해야 하며 이 경우 승인 엔드포인트와 토큰 교환 엔드포인트가 있어야 합니다.

사용자를 인증하면 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.

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을 참조하세요.