アシスタント用の Google ログイン(GSI)は最もシームレスなリンクを実現する
デベロッパーにとって最も簡単なフローです。
GSI を使用すると、作成中にアクションがユーザーの Google プロフィールへのアクセスをリクエストできます。
会話を受信し、ユーザーが同意した場合は、ユーザーの名前、メールアドレス、
プロフィール写真が表示されます。アクションはこの情報を使用して、
システム内の Google アカウントをユーザーが持っているかどうか。そうでない場合、アクションはユーザーに
Google アカウントに基づいてシステムで新しいアカウントを作成することを
プロフィール情報
次のいずれかに該当する場合は、GSI がおすすめのアカウント リンク ソリューションとなります。
既存の認証システムがない、またはすべての
ユーザーが Google アカウントを持つようにできます。たとえば、アクションが
すべてのユーザーは Google アシスタントを
できます。
既存の認証システムがあり、
ユーザーの Google アカウントを使用してシステムにログインしました。
Google ID トークン: 以下を含むユーザー ID の署名付きアサーション
ユーザーの基本的な Google プロフィール情報(名前、メールアドレス、
プロフィール写真など)。Google ID トークンとは、
JSON Web Token
(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"}
この例では、actions.intent.SIGN_IN ヘルパー インテントを
使用します。このインテントはユーザーに権限を求めます。
Google プロフィール情報にアクセスする。
ユーザーが同意すると、アシスタントは
user@gmail.com のプロフィール情報。この場合、
user@gmail.com の Google ID トークンに含まれるものが、次のアカウントと一致:
ユーザーの ID が自動的にリンクされるため、
そのアカウントにリンクしますこれで Webhook はユーザーの通常の注文を
それに応じて対応できます
[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."]]