AccountLinking
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
AccountLinking 可让 Google 引导用户登录到应用的网络服务。
对于“Google 登录”和“OAuth + Google 登录”关联类型,Google 会生成用于向 Google 标识您的应用的客户端 ID(控制台界面上的“Client ID by Google to your Actions”)。此字段是只读字段,您可以转到控制台界面的“账号关联”页面进行查看。请参阅:https://developers.google.com/assistant/identity/google-sign-in
注意:对于所有的账号关联设置类型(Google 登录除外),您必须在 Settings.testing_instructions 中提供测试账号的用户名和密码,以便审核团队审核应用(用户看不到这些信息)。
YAML 表示法 |
enableAccountCreation: boolean
linkingType: enum (LinkingType )
authGrantType: enum (AuthGrantType )
appClientId: string
authorizationUrl: string
tokenUrl: string
scopes:
- string
learnMoreUrl: string
useBasicAuthHeader: boolean |
字段 |
enableAccountCreation |
boolean
必需。如果设为 true ,用户就可以通过语音注册新账号。如果设为 false ,则仅允许在您的网站上创建账号。如果您想在注册期间显示您的服务条款或征求用户同意,请选择此选项。当此类型为 false 时,linkingType 不能为 GOOGLE_SIGN_IN。如果关联类型为 true ,则关联类型不能为 OAUTH。
|
linkingType |
enum (LinkingType )
必需。要使用的关联类型。如需详细了解关联类型,请参阅 https://developers.google.com/assistant/identity。
|
authGrantType |
enum (AuthGrantType )
可选。表示 OAUTH linksType 的身份验证类型。
|
appClientId |
string
可选。您的应用发送给 Google 的客户端 ID。这是用于向您的服务标识 Google 的 OAuth2 客户端 ID。仅在使用 OAuth 时设置。
|
authorizationUrl |
string
可选。支持 OAuth2 代码或隐式流程的登录网页的端点。网址必须使用 HTTPS。仅在使用 OAuth 时设置。
|
tokenUrl |
string
可选。用于交换令牌的 OAuth2 端点。网址必须使用 HTTPS。仅当将 OAuth 与 IMPLICIT 授权用作关联类型时,才未设置此关联类型。仅在使用 OAuth 时设置。
|
scopes[] |
string
可选。用户必须同意才能使用您的服务的权限列表。仅在使用 OAuth 时设置。如果指定此字段,请务必在 LocalizedSettings.terms_of_service_url 部分中的目录信息中提供服务条款。
|
learnMoreUrl |
string
可选。这是您服务中的网页,其中描述了用户向 Google 授予的权限。仅在使用 OAuth 和 Google 登录时才设置。如果指定此字段,请务必在 LocalizedSettings.terms_of_service_url 部分中的目录信息中提供服务条款。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eAccount Linking enables users to sign in to your app's web services through Google.\u003c/p\u003e\n"],["\u003cp\u003eFor Google Sign-In and OAuth linking, a Client ID is generated by Google and displayed in the Actions Console.\u003c/p\u003e\n"],["\u003cp\u003eFor all other linking types, provide test account credentials for review purposes in \u003ccode\u003eSettings.testing_instructions\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou must configure account linking settings like \u003ccode\u003eenableAccountCreation\u003c/code\u003e, \u003ccode\u003elinkingType\u003c/code\u003e, and optional OAuth parameters in your action's YAML configuration.\u003c/p\u003e\n"],["\u003cp\u003eWhen using OAuth, provide necessary information like authorization and token URLs, scopes, and optionally, a \u003ccode\u003elearnMoreUrl\u003c/code\u003e and basic authentication settings.\u003c/p\u003e\n"]]],["Account linking enables Google to guide users to sign in to an app's web services. For certain linking types, Google provides a read-only Client ID. Settings require a test account's username and password, except with Google Sign In. The YAML representation defines fields like `enableAccountCreation`, `linkingType`, `authGrantType`, and URLs for authorization and token exchange. OAuth requires specifying `appClientId`, `scopes`, and possibly `learnMoreUrl` and `useBasicAuthHeader`. The `enableAccountCreation` boolean determines if account creation is done via voice.\n"],null,["# AccountLinking\n\n- [YAML representation](#SCHEMA_REPRESENTATION)\n\nAccountLinking allows Google to guide the user to sign-in to the App's web services.\n\nFor Google Sign In and OAuth + Google Sign In linking types, Google generates a client ID identifying your App to Google (\"Client ID issued by Google to your Actions\" on Console UI). This field is read-only and can be checked by navigating to the Console UI's Account Linking page. See: \u003chttps://developers.google.com/assistant/identity/google-sign-in\u003e\n\nNote: For all account linking setting types (except for Google Sign In), you must provide a username and password for a test account in Settings.testing_instructions for the review team to review the app (they will not be visible to users).\n\n| YAML representation ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` enableAccountCreation: boolean linkingType: enum (/assistant/actionssdk/reference/rest/Shared.Types/LinkingType) authGrantType: enum (/assistant/actionssdk/reference/rest/Shared.Types/AuthGrantType) appClientId: string authorizationUrl: string tokenUrl: string scopes: - string learnMoreUrl: string useBasicAuthHeader: boolean ``` |\n\n| Fields ||\n|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `enableAccountCreation` | `boolean` Required. If `true`, users are allowed to sign up for new accounts via voice. If `false`, account creation is only allowed on your website. Select this option if you want to display your terms of service or obtain user consents during sign-up. linkingType cannot be GOOGLE_SIGN_IN when this is `false`. linkingType cannot be OAUTH when this is `true`. |\n| `linkingType` | `enum (`[LinkingType](/assistant/actionssdk/reference/rest/Shared.Types/LinkingType)`)` Required. The linking type to use. See \u003chttps://developers.google.com/assistant/identity\u003e for further details on the linking types. |\n| `authGrantType` | `enum (`[AuthGrantType](/assistant/actionssdk/reference/rest/Shared.Types/AuthGrantType)`)` Optional. Indicates the type of authentication for OAUTH linkingType. |\n| `appClientId` | `string` Optional. Client ID issued by your App to Google. This is the OAuth2 Client ID identifying Google to your service. Only set when using OAuth. |\n| `authorizationUrl` | `string` Optional. Endpoint for your sign-in web page that supports OAuth2 code or implicit flows. URL must use HTTPS. Only set when using OAuth. |\n| `tokenUrl` | `string` Optional. OAuth2 endpoint for token exchange. URL must use HTTPS. This is not set when only using OAuth with IMPLICIT grant as the linking type. Only set when using OAuth. |\n| `scopes[]` | `string` Optional. List of permissions the user must consent to in order to use your service. Only set when using OAuth. Make sure to provide a Terms of Service in the directory information in LocalizedSettings.terms_of_service_url section if specifying this field. |\n| `learnMoreUrl` | `string` Optional. This is the web page on your service which describes the permissions the user is granting to Google. Only set if using OAuth and Google Sign In. Make sure to provide a Terms of Service in the directory information in LocalizedSettings.terms_of_service_url section if specifying this field. |\n| `useBasicAuthHeader` | `boolean` Optional. If true, allow Google to transmit client ID and secret via HTTP basic auth header. Otherwise, Google uses the client ID and secret inside the post body. Only set when using OAuth. Make sure to provide a Terms of Service in the directory information in LocalizedSettings.terms_of_service_url section if specifying this field. |"]]