가장 원활한 연결을 제공하는 어시스턴트용 Google 로그인 (GSI)
환경을 조성하고 개발자가 구현할 수 있는 가장 쉬운 흐름입니다.
GSI를 사용하면 작업에서 사용자의 Google 프로필에 대한 액세스를 요청할 수 있습니다.
사용자가 동의하면 사용자의 이름, 이메일 주소, 이메일 주소
프로필 사진입니다. 그러면 작업에서 이 정보를 사용하여
사용자의 시스템에 Google 계정이 있습니다. 그렇지 않은 경우 작업에서 사용자에게 다음 사항을 묻습니다.
자신의 Google 계정을 기반으로 시스템에 새 계정을 만들고자 하는 경우
프로필 정보
GSI는 다음 중 하나라도 해당하는 경우 권장되는 계정 연결 솔루션입니다.
기존 인증 시스템이 없거나
사용자에게 Google 계정이 있어야 합니다. 예를 들어 작업이
어시스턴트를 타겟팅하면 모든 사용자가 Google
있습니다.
기존 인증 시스템이 있고 다음과 같은 사용자만 연결하려고 할 때
Google 계정을 사용하여 시스템에 로그인했습니다.
GSI가 적합한 솔루션인지 확인하려면 다음을 참조하세요.
계정 연결 유형 선택 페이지를 참고하세요.
핵심 용어
GSI의 작동 방식을 읽기 전에 다음 용어를 숙지하시기 바랍니다.
Google ID 토큰: 사용자 ID에 대한 서명된 어설션으로,
사용자의 기본 Google 프로필 정보 (이름, 이메일 주소,
프로필 사진) Google ID 토큰은
JSON 웹 토큰
(JWT).
다음은 디코딩된 토큰의 예입니다.
{"sub":1234567890,// The unique ID of the user's Google Account"iss":"https://accounts.google.com",// The token's issuer"aud":"123-abc.apps.googleusercontent.com",// Client ID assigned to your Actions project"iat":233366400,// Unix timestamp of the token's creation time"exp":233370000,// Unix timestamp of the token's expiration time"name":"Jan Jansen","given_name":"Jan","family_name":"Jansen","email":"jan@gmail.com",// If present, the user's email address"locale":"en_US"}
계정 로그인 도우미 인텐트: 호출하는 도우미 인텐트입니다.
어시스턴트에서 계정 연결 흐름을 요청합니다. 자세한 내용은
계정 로그인을 참조하세요.
컨텍스트 문자열: 계정에 추가하는 맞춤설정된 문자열입니다.
사용자에게 연결해야 하는 이유를 알려주는 로그인 도우미 인텐트
계정을 만들 수 있습니다.
작동 방식
GSI의 기본 흐름은 다음과 같습니다.
작업에서 사용자에게 Google 프로필에 액세스하는 데 동의를 요청합니다.
사용자가 동의하면 작업에서 Google ID 토큰을 수신합니다.
사용자의 Google 프로필 정보가 포함됩니다.
토큰을 검증하고 디코딩하여 프로필 콘텐츠를 읽습니다.
Node.js용 Actions on Google 클라이언트 라이브러리 또는 Java 클라이언트 라이브러리
토큰을 검증하고 디코딩합니다.
작업은 이 토큰을 사용하여 사용자의 Google 프로필
존재하는지 확인하는 것이 중요합니다.
로그인했다면 사용자가 이미
Google 계정 사용자는
사용자의 신원을 Google 계정에 연결한 어시스턴트
그렇지 않은 경우 사용자는
Google ID 토큰에 포함된 정보 그러면 사용자는
새 계정이 연결된 상태에서 어시스턴트와 대화를 계속할 수 있습니다.
Google 로그인 흐름
이 섹션에서는 Google 로그인에서 발생할 수 있는 다양한 흐름을 설명합니다.
흐름 1: 시스템에 사용자 정보가 존재함
다음 다이어그램은
사용자의 정보가 시스템에 이미 존재합니다.
이 경우 actions.intent.SIGN_IN 도우미 인텐트를 호출합니다.
맞춤설정할 수 있습니다. 이 인텐트는 사용자에게
Google 프로필 정보에 액세스할 수 없습니다.
사용자가 동의하면 어시스턴트는
user@gmail.com의 프로필 정보 이 경우
user@gmail.com에 대한 Google ID 토큰에 포함된
사용자의 ID가 시스템에 자동으로 연결되므로
하세요. 그러면 웹훅에서 사용자의 일반적인 주문을 읽을 수 있습니다.
이에 따라 대응해야 합니다
흐름 2: 시스템에 사용자 정보가 없는 경우
다음 다이어그램은 다음과 같은 경우 GSI에서 발생하는 엔드 투 엔드 흐름을 보여줍니다.
사용자 정보가 시스템에 존재하지 않는 경우:
이 경우
user@gmail.com이(가) 시스템에 있는 계정과 일치하지 않으므로 어시스턴트가
에서 사용자에게 새 계정을 만들 것인지 묻습니다. 사용자는
계정 생성 프로세스를
검증 기기
사용자가 계정 생성에 동의하면 서비스에서 이 정보를 사용합니다.
ID 토큰 (사용자 이름 및 이메일 주소)을
있습니다. 계정이 생성되면 작업의 사용자 ID
새 Google 계정에 연결됩니다.
이 경우 사용자는 신규 고객이므로 일반적인 주문이 없습니다.
서비스에서 주문하려는 항목을 묻습니다. 나
또한 사용자에게 가장 최근 주문을 설정하고 싶은지 물어볼 수도 있습니다.
평소의 순서로 하겠습니다.
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eGoogle Sign-In (GSI) offers a seamless account linking experience for Assistant users and is the easiest for developers to implement, allowing Actions to request access to a user's Google profile for name, email, and picture for account verification or creation.\u003c/p\u003e\n"],["\u003cp\u003eGSI is recommended if you lack an existing authentication system, expect all users to have Google accounts, or want to link users who have signed in using their Google accounts.\u003c/p\u003e\n"],["\u003cp\u003eUpon user consent, your Action receives a Google ID token containing user profile information, which is used to check if the user exists in your system; if so, the user is linked; if not, the user is prompted to create a new account using their Google profile.\u003c/p\u003e\n"],["\u003cp\u003eIf a user's information isn't found, they can create a new account using their Google profile, and their identity in your Action is linked to their new Google account.\u003c/p\u003e\n"]]],["Google Sign-In (GSI) allows Actions to request user's Google profile information (name, email, picture) with user consent. If the user's information exists in the system, their identity is automatically linked; otherwise, the user can create a new account using their Google profile. The Action receives a Google ID token, validates and decodes it. The user can continue using the Action after the linking of the Google account. User can be a guest if they can not be identified.\n"],null,["# Google Sign-In concept guide (Dialogflow)\n\nGoogle Sign-In (GSI) for the Assistant provides the most seamless linking\nexperience for users and is the easiest flow for developers to implement.\nWith GSI, your Action can request access to your user's Google profile during\na conversation and, if the user consents, receive the user's name, email address,\nand profile picture. Your Action can then use this information to check if the\nuser has a Google account in your system. If not, your Action asks the user if\nthey want to create a new account in your system based on their Google\nprofile information.\n| **Note:** Your user is either a) identified through voice recognition or b) configured on the device. If the user's voice is verified but not recognized, the user is considered a guest.\n\nGSI is the recommended account linking solution if any of the following applies:\n\n- You don't have an existing authentication system and/or you expect all your users to have a Google account. For example, if your Action is specifically targeting the Assistant, you can expect all your users to have Google accounts.\n- You have an existing authentication system and only want to link users who signed into your system using their Google accounts.\n\nTo verify that GSI is the right solution for you, see the\n[Choose your account linking type](/assistant/df-asdk/identity/choose-type) page.\n\nKey terms\n---------\n\nBefore you read about how GSI works, familiarize yourself with the following terms:\n\n- **Google ID token:** A signed assertion of a user's identity that contains\n a user's basic Google profile information (their name, email address, and\n profile picture). A Google ID token is a\n [JSON Web Token](https://en.wikipedia.org/wiki/JSON_Web_Token)\n (JWT).\n\n The following is an example of a decoded token:\n\n```carbon\n{\n \"sub\": 1234567890, // The unique ID of the user's Google Account\n \"iss\": \"https://accounts.google.com\", // The token's issuer\n \"aud\": \"123-abc.apps.googleusercontent.com\", // Client ID assigned to your Actions project\n \"iat\": 233366400, // Unix timestamp of the token's creation time\n \"exp\": 233370000, // Unix timestamp of the token's expiration time\n \"name\": \"Jan Jansen\",\n \"given_name\": \"Jan\",\n \"family_name\": \"Jansen\",\n \"email\": \"jan@gmail.com\", // If present, the user's email address\n \"locale\": \"en_US\"\n}\n```\n\n- **Account sign-in helper intent:** A helper intent that you call to request an account linking flow from the Assistant. For more information, see [Account Sign-in](/assistant/df-asdk/helpers#account_sign-in).\n - **Context string:** A customized string that you add to the account sign-in helper intent that tells the user why you need them to link their account.\n\nHow it works\n------------\n\nThe fundamental flow for GSI is as follows:\n\n1. Your Action asks the user for consent to access their Google profile.\n2. After the user gives consent, your Action receives a Google ID token that contains the user's Google profile information.\n3. Validate and decode the token to read the profile content. If you use the Actions on Google client library for Node.js or the Java client library, it validates and decodes the token for you.\n4. Your Action uses this token to check if the user's Google profile\n information exists in your system.\n\n 1. If it does, the user has already signed into your system with their Google account. The user can continue the conversation with the Assistant with their identity linked to their Google account.\n 2. If it doesn't, the user can create a new account in your system with\n the information contained in the Google ID token. The user can then\n continue the conversation with the Assistant with their new account linked.\n\n | **Note:** New accounts do not typically have a password set. It is recommended that you add Google Sign In to other platforms to enable users to log in via Google across the surfaces of your application. Alternatively, you can email the user a link that starts your password recovery flow to allow the user to set a password for signing in on other platforms.\n\nGoogle Sign-in flows\n--------------------\n\nThis section describes the various flows that can occur with Google Sign-in.\n| **Note:** The following flows assume the user gives consent for your Action to access their Google profile information. If a user doesn't give consent, provide them a way to continue in your Action with an alternate, limited flow. For more information, see [Best practices](/assistant/df-asdk/identity/best-practices).\n\n### Flow 1: User's information exists in your system\n\nThe following diagram shows the end-to-end flow that occurs with GSI when the\nuser's information already exists in your system:\n\n| **Note:** A line from *Webhook* to *User* represents a [simple response](/assistant/df-asdk/simple-responses) that you create and customize. Lines drawn from *Assistant* to *User* represent prompts that are owned by the Assistant and have limited options for customization (requests that require permission are always owned by the Assistant). From the user's perspective, both kinds of responses are delivered from the Assistant.\n\nIn this case, you call the `actions.intent.SIGN_IN` helper intent with a\ncontext string you customize. This intent asks the user for permission to\naccess their Google profile information.\n\nAfter the user consents, the Assistant sends a request that contains the\nprofile information for `user@gmail.com`. In this case, the information\ncontained in the Google ID token for `user@gmail.com` matches an account in\nyour system, so the user's identity in your Action is automatically linked\nto that account. Your webhook can then read the user's usual order from\na database and respond accordingly.\n\n### Flow 2: User's information does not exist in your system\n\nThe following diagram shows the end-to-end flow that occurs with GSI when\nthe user's information does not exist in your system:\n\nIn this case, the information contained in the Google ID token for\n`user@gmail.com` does not match an account in your system, so the Assistant\nasks the user if they'd like to create a new account. The user can complete\nthe account creation process with voice rather than transferring to\na screened device.\n\nWhen the user agrees to create an account, your service uses the information\nin the ID token (the user's name and email address) to create an account for\nthe user. Once the account is created, the user's identity in your Action\nis linked to their new Google account.\n\nIn this case, the user does not have a usual order because they are new to\nthe service, so your Action asks what they want to order. You\ncan also ask the user if they'd like to set their most recent order\nas their usual order."]]