[null,null,["最后更新时间 (UTC):2023-11-02。"],[[["\u003cp\u003eAccount linking lets you connect users' Google accounts with your system, enabling personalized experiences by saving preferences and history.\u003c/p\u003e\n"],["\u003cp\u003eActions on Google offers three account linking types: Google Sign-In (recommended for Assistant-only Actions), OAuth-based Google Sign-in "Streamlined" linking (recommended for multi-platform Actions), and OAuth linking (least recommended).\u003c/p\u003e\n"],["\u003cp\u003eGoogle Sign-In allows users to sign in with their Google profile, including name, email, and picture, providing a frictionless experience.\u003c/p\u003e\n"],["\u003cp\u003eOAuth-based Google Sign-in "Streamlined" linking combines Google Sign-In with OAuth, enabling both Google and non-Google identities for linking.\u003c/p\u003e\n"],["\u003cp\u003eOAuth linking supports standard OAuth flows but is discouraged due to requiring screen interaction; it's suitable if you have an existing OAuth 2.0 server and cannot extend it for automatic linking.\u003c/p\u003e\n"]]],["Account linking connects user accounts across platforms, allowing personalized experiences and consistent cross-platform access. There are three types: Google Sign-In, ideal for Assistant-only Actions or Gmail users; OAuth-based Google Sign-in \"Streamlined\" linking, best for multi-platform users with Google and non-Google accounts; and OAuth linking for existing OAuth 2.0 servers, although voice to screen transition is required. If a linked Action is unhealthy, issues must be resolved in seven days to avoid removal. Account linking is unavailable on Android (Go edition) and KaiOS devices.\n"],null,["# Account linking\n\n| **Note:** Actions that enable account linking aren't currently available on Android (Go edition) or KaiOS devices.\n\nYou can use account linking to connect your users' Google accounts with user\naccounts in your authentication system. This allows you to build richer\nexperiences for your users; for example, you can save the user's food or music\npreferences, history of transactions, and other information that you can use\nto provide a more personalized experience.\n\nIf your Action is a companion of existing apps on different platforms (for example,\nthe web or Android), you can use account linking to securely make users' preferences\navailable to all platforms, which ensures a consistent cross-platform experience.\n\nAccount linking for Actions on Google uses [Google Sign-In](/identity),\nGoogle's secure authentication system, and optionally, [OAuth 2.0](https://oauth.net/2/) ,\nthe industry-standard protocol for authorization.\n| **Note:** Google monitors the functionality of the account linking flow in your Action. If your Action that uses account linking is marked as unhealthy, Google sends you a notification email. Upon receipt of this email, you have 7 days to fix the issue; otherwise, your agent will be taken down. For more information, see [health checks](/assistant/console/health-checks).\n\nUnderstand the account linking flow\n-----------------------------------\n\nWhen Assistant matches a Google account to a user, you can use account\nlinking to ask for the user's permission to access that Google account. You can use\nthe account data to do the following:\n\n- To find a match for the account in your authentication system if the user has already used your Action or one of your apps on other platforms.\n- To create a new account in your authentication system for a new user.\n\nActions on Google offers three different account linking types.\n\n### Google Sign-In\n\n**Figure 1**: The Google Sign-In only account linking type is the recommended solution for Actions that target only Assistant.\n\nWith *Google Sign-In for the Assistant*, your Action can request access to your user's\nGoogle profile during a conversation, including the user's name, email address,\nand profile picture. The user can complete the whole flow over voice, which provides\na frictionless sign-in experience.\n\nThis type of account linking is recommended if **any** of the following applies:\n\n- You don't have an existing authentication system.\n- You have an existing authentication system and only want to link to users who signed up to your existing apps using their @gmail.com address.\n\nTo learn more, see the [Google Sign-In concept guide](/assistant/identity/gsi-concept-guide)\nand [implementation guide](/assistant/identity/google-sign-in).\n\n### OAuth-based Google Sign-in \"Streamlined\" linking\n\n**Figure 2**: Streamlined linking is the recommended solution for multi-platform Actions.\n\nThe *OAuth-based Google Sign-in \"Streamlined\" linking* type adds Google Sign-In on top of OAuth based\naccount linking. This provides seamless voice-based linking for Google users\nwhile also enabling account linking for users who registered to your service\nwith a non-Google identity.\n\nTo use this flow, you need to extend one of the supported OAuth 2.0 standard flows\nto add support for Google proprietary extensions of the protocol, which allow you\nto:\n\n- Seamlessly link accounts using the Google profile information.\n- Seamlessly create new accounts using the Google profile information (optional).\n\nThis type of account linking is recommended if you have an existing authentication\nsystem and you want to allow users to connect to non @gmail.com addresses.\n\nTo learn more, see the [OAuth-based Google Sign-in \"Streamlined\" linking concept guide](/assistant/identity/gsi-oauth-concept-guide)\nand [implementation guide](/assistant/identity/google-sign-in-oauth).\n| **Note:** You can use the Streamlined linking type with the authorization code flow to implement [OAuth-based App Flip](/assistant/identity/app-flip), which provides a faster and easier linking process for the user.\n\n### OAuth linking\n\nThe *OAuth linking* type supports two industry standard OAuth 2.0 flows,\nthe *implicit* and *authorization* code flows.\n\nUsing this flow is discouraged because it requires transferring the user interaction\nfrom voice to screen. You can consider using this flow if you have an existing\nimplementation of an OAuth 2.0 server, and you cannot extend the token exchange endpoint\nto add support for Google's protocols for automatic linking and account creation\nfrom an ID token.\n\nTo learn more, see the [OAuth linking concept guide](/assistant/identity/oauth-concept-guide)\nand [implementation guide](/assistant/identity/oauth2).\n| **Note:** You can use the OAuth linking type with the authorization code flow to implement [OAuth-based App Flip](/assistant/identity/app-flip), which provides a faster and easier linking process for the user.\n\nRelated resources\n-----------------\n\nFor more information about implementing account linking in your Action, see the\nfollowing resource:\n\n- [Account linking: Dialogflow](https://www.youtube.com/watch?v=JYmTBT7DvSM): An introduction to the linking types you can implement in your Action."]]