# Method: projects.locations.accountConnectors.users.finishOAuthFlow

- [HTTP request](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.request_body)
- [Response body](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.FinishOAuthResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#body.aspect_1)
- [OAuthParams](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#OAuthParams)
  - [JSON representation](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#OAuthParams.SCHEMA_REPRESENTATION)
- [GoogleOAuthParams](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#GoogleOAuthParams)
  - [JSON representation](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#GoogleOAuthParams.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#try-it)

Finishes OAuth flow for an account connector.

### HTTP request

`GET https://developerconnect.googleapis.com/v1/{accountConnector=projects/*/locations/*/accountConnectors/*}/users:finishOAuthFlow`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `accountConnector` | `string` Required. The resource name of the AccountConnector in the format `projects/*/locations/*/accountConnectors/*`. |

### Query parameters

| Parameters ||
|---|---|
| Union parameter `params`. The params returned by OAuth flow redirect. `params` can be only one of the following: ||
| `oauthParams` | ``object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#OAuthParams`)`` The params returned by non-Google OAuth 2.0 flow redirect. |
| `googleOauthParams` | ``object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.accountConnectors.users/finishOAuthFlow#GoogleOAuthParams`)`` The params returned by Google OAuth flow redirects. |

### Request body

The request body must be empty.

### Response body

Message for responding to finishing an OAuth flow.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "exchangeError": { object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/ExchangeError`) } } ``` |

| Fields ||
|---|---|
| `exchangeError` | ``object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/ExchangeError`)`` The error resulted from exchanging OAuth tokens from the service provider. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `accountConnector` resource:

- `developerconnect.users.finishOAuth`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## OAuthParams

The params returned by non-Google OAuth 2.0 flow redirect.

| JSON representation |
|---|
| ``` { "code": string, "ticket": string } ``` |

| Fields ||
|---|---|
| `code` | `string` Required. The code to be used for getting the token from SCM provider. |
| `ticket` | `string` Required. The ticket to be used for post processing the callback from SCM provider. |

## GoogleOAuthParams

The params returned by Google OAuth flow redirects.

| JSON representation |
|---|
| ``` { "scopes": [ string ], "versionInfo": string, "ticket": string } ``` |

| Fields ||
|---|---|
| `scopes[]` | `string` Required. The scopes returned by Google OAuth flow. |
| `versionInfo` | `string` Optional. The version info returned by Google OAuth flow. |
| `ticket` | `string` Required. The ticket to be used for post processing the callback from Google OAuth flow. |