# AccountLinking

- [JSON representation](https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#SCHEMA_REPRESENTATION)
- [AndroidAppFlip](https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#AndroidAppFlip)
  - [JSON representation](https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#AndroidAppFlip.SCHEMA_REPRESENTATION)
- [IosAppFlip](https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#IosAppFlip)
  - [JSON representation](https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#IosAppFlip.SCHEMA_REPRESENTATION)

AccountLinking is used for the App to allow Google to guide user to sign-in to the App's web services.

| JSON representation ||
|---|---|
| ``` { "clientId": string, "clientSecret": string, "grantType": enum (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AuthGrantType`), "authenticationUrl": string, "accessTokenUrl": string, "scopes": [ string ], "scopeExplanationUrl": string, "googleSignInClientId": string, "assertionTypes": [ enum (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AssertionType`) ], "basicAuthHeaderForTokenEndpoint": boolean, "revocationEndpoint": string, "androidAppFlip": [ { object (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#AndroidAppFlip`) } ], "iosAppFlip": [ { object (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#IosAppFlip`) } ] } ``` |

| Fields ||
|---|---|
| `clientId` | `string` Unique public string used to identify client requesting authentication. |
| `clientSecret` | `string` Client secret maintained by the developer. |
| `grantType` | ``enum (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AuthGrantType`)`` Indicates type of authentication. |
| `authenticationUrl` | `string` The url where users will be redirected to for entering login credentials, for example, `https://login.example.org/oauth/v2/authorize`. |
| `accessTokenUrl` | `string` The url to fetch the access token given an authorization code, for example, `https://login.example.org/oauth/v2/token`. |
| `scopes[]` | `string` List of scopes user needs to grant permission for. Up to 10 scopes are supported. |
| `scopeExplanationUrl` | `string` The App's URL for displaying information about the scopes for which the access token is being granted. The URL will be appended with a query parameter "scopes" containing a list of scopes being requested, e.g.: `?scopes=scope1+scope2+scope3`. |
| `googleSignInClientId` | `string` The Google API Console OAuth 2.0 client ID that is being used by the App for Google Sign-In. This field is required for the `ID_TOKEN` assertion type, it's used in the `aud` (audience) field of the ID token: <http://openid.net/specs/openid-connect-core-1_0.html#IDToken>. See <https://developers.google.com/identity/protocols/OpenIDConnect> for more information on ID token. |
| `assertionTypes[]` | ``enum (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AssertionType`)`` The list of assertion types that the App can support at the token endpoint. |
| `basicAuthHeaderForTokenEndpoint` | `boolean` Uses basic auth header for token endpoint if this field is set to true. Otherwise, uses the client id and secret inside the post body. |
| `revocationEndpoint` | `string` token revocation endpoint, please refer to IdP's developer document to find the correct value. For example, <https://login.example.com/oauth/revoke>. |
| `androidAppFlip[]` | ``object (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#AndroidAppFlip`)`` Account Linking config for Android AppFlip. |
| `iosAppFlip[]` | ``object (`https://developers.google.com/assistant/df-asdk/reference/action-package/rest/Shared.Types/AccountLinking#IosAppFlip`)`` Account Linking config iOS AppFlip. |

## AndroidAppFlip

Account Linking config for Android AppFlip.

| JSON representation ||
|---|---|
| ``` { "appPackageName": string, "appSignature": string, "appFlipIntent": string } ``` |

| Fields ||
|---|---|
| `appPackageName` | `string` Package name of the 3P app. |
| `appSignature` | `string` The SHA-256 fingerprint of their signing signature for the 3P app. |
| `appFlipIntent` | `string` The intent action that should be used to start the 3P app. |

## IosAppFlip

Account Linking config iOS AppFlip.

| JSON representation ||
|---|---|
| ``` { "universalLink": string } ``` |

| Fields ||
|---|---|
| `universalLink` | `string` universal link for 3P app. |