account_linking.proto 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.actions.sdk.v2;
  16. import "google/api/field_behavior.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2;sdk";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "AccountLinkingProto";
  20. option java_package = "com.google.actions.sdk.v2";
  21. // AccountLinking allows Google to guide the user to sign-in to the App's web
  22. // services.
  23. //
  24. // For Google Sign In and OAuth + Google Sign In linking types, Google generates
  25. // a client ID identifying your App to Google ("Client ID issued by Google to
  26. // your Actions" on Console UI). This field is read-only and can be checked by
  27. // navigating to the Console UI's Account Linking page.
  28. // See: https://developers.google.com/assistant/identity/google-sign-in
  29. //
  30. // Note: For all account linking setting types (except for Google Sign In), you
  31. // must provide a username and password for a test account in
  32. // Settings.testing_instructions for the review team to review the app (they
  33. // will not be visible to users).
  34. message AccountLinking {
  35. // The type of Account Linking to perform.
  36. enum LinkingType {
  37. // Unspecified.
  38. LINKING_TYPE_UNSPECIFIED = 0;
  39. // Google Sign In linking type.
  40. // If using this linking type, no OAuth-related fields need to be set below.
  41. GOOGLE_SIGN_IN = 1;
  42. // OAuth and Google Sign In linking type.
  43. OAUTH_AND_GOOGLE_SIGN_IN = 2;
  44. // OAuth linking type.
  45. OAUTH = 3;
  46. }
  47. // The OAuth2 grant type Google uses to guide the user to sign in to your
  48. // App's web service.
  49. enum AuthGrantType {
  50. // Unspecified.
  51. AUTH_GRANT_TYPE_UNSPECIFIED = 0;
  52. // Authorization code grant. Requires you to provide both
  53. // authentication URL and access token URL.
  54. AUTH_CODE = 1;
  55. // Implicit code grant. Only requires you to provide authentication
  56. // URL.
  57. IMPLICIT = 2;
  58. }
  59. // Required. If `true`, users are allowed to sign up for new accounts via voice.
  60. // If `false`, account creation is only allowed on your website. Select this
  61. // option if you want to display your terms of service or obtain user consents
  62. // during sign-up.
  63. // linking_type cannot be GOOGLE_SIGN_IN when this is `false`.
  64. // linking_type cannot be OAUTH when this is `true`.
  65. bool enable_account_creation = 1 [(google.api.field_behavior) = REQUIRED];
  66. // Required. The linking type to use.
  67. // See https://developers.google.com/assistant/identity for further details on
  68. // the linking types.
  69. LinkingType linking_type = 2 [(google.api.field_behavior) = REQUIRED];
  70. // Optional. Indicates the type of authentication for OAUTH linking_type.
  71. AuthGrantType auth_grant_type = 3 [(google.api.field_behavior) = OPTIONAL];
  72. // Optional. Client ID issued by your App to Google.
  73. // This is the OAuth2 Client ID identifying Google to your service.
  74. // Only set when using OAuth.
  75. string app_client_id = 4 [(google.api.field_behavior) = OPTIONAL];
  76. // Optional. Endpoint for your sign-in web page that supports OAuth2 code or
  77. // implicit flows.
  78. // URL must use HTTPS.
  79. // Only set when using OAuth.
  80. string authorization_url = 5 [(google.api.field_behavior) = OPTIONAL];
  81. // Optional. OAuth2 endpoint for token exchange.
  82. // URL must use HTTPS.
  83. // This is not set when only using OAuth with IMPLICIT grant as the
  84. // linking type.
  85. // Only set when using OAuth.
  86. string token_url = 6 [(google.api.field_behavior) = OPTIONAL];
  87. // Optional. List of permissions the user must consent to in order to use
  88. // your service.
  89. // Only set when using OAuth.
  90. // Make sure to provide a Terms of Service in the directory information in
  91. // LocalizedSettings.terms_of_service_url section if specifying this field.
  92. repeated string scopes = 7 [(google.api.field_behavior) = OPTIONAL];
  93. // Optional. This is the web page on your service which describes the
  94. // permissions the user is granting to Google.
  95. // Only set if using OAuth and Google Sign In.
  96. // Make sure to provide a Terms of Service in the directory information in
  97. // LocalizedSettings.terms_of_service_url section if specifying this field.
  98. string learn_more_url = 8 [(google.api.field_behavior) = OPTIONAL];
  99. // Optional. If true, allow Google to transmit client ID and secret via HTTP
  100. // basic auth header. Otherwise, Google uses the client ID and secret inside
  101. // the post body.
  102. // Only set when using OAuth.
  103. // Make sure to provide a Terms of Service in the directory information in
  104. // LocalizedSettings.terms_of_service_url section if specifying this field.
  105. bool use_basic_auth_header = 9 [(google.api.field_behavior) = OPTIONAL];
  106. }