# Method: accounts.mfaSignIn.finalize

- [HTTP request](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#body.HTTP_TEMPLATE)
- [Request body](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#body.FinalizeMfaSignInResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#body.aspect)
- [MfaTotpSignInRequestInfo](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#MfaTotpSignInRequestInfo)
  - [JSON representation](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#MfaTotpSignInRequestInfo.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#try-it)

Verifies the MFA challenge and performs sign-in

### HTTP request

`POST https://identitytoolkit.googleapis.com/v2/accounts/mfaSignIn:finalize`

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

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "mfaPendingCredential": string, "tenantId": string, "mfaEnrollmentId": string, // Union field `verification_info` can be only one of the following: "phoneVerificationInfo": { object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/FinalizeMfaPhoneRequestInfo`) }, "totpVerificationInfo": { object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#MfaTotpSignInRequestInfo`) } // End of list of possible types for union field `verification_info`. } ``` |

| Fields ||
|---|---|
| `mfaPendingCredential` | `string` Required. Pending credential from first factor sign-in. |
| `tenantId` | `string` The ID of the Identity Platform tenant the user is signing in to. If not set, the user will sign in to the default Identity Platform project. |
| `mfaEnrollmentId` | `string` The MFA enrollment ID from the user's list of current MFA enrollments. |
| Union field `verification_info`. Proof of completion of the MFA challenge. `verification_info` can be only one of the following: ||
| `phoneVerificationInfo` | ``object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/FinalizeMfaPhoneRequestInfo`)`` Proof of completion of the SMS based MFA challenge. |
| `totpVerificationInfo` | ``object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaSignIn/finalize#MfaTotpSignInRequestInfo`)`` Proof of completion of the TOTP based MFA challenge. |

### Response body

mfaSignIn.finalize response.

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

| JSON representation |
|---|
| ``` { "idToken": string, "refreshToken": string, // Union field `auxiliary_auth_info` can be only one of the following: "phoneAuthInfo": { object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/FinalizeMfaPhoneResponseInfo`) } // End of list of possible types for union field `auxiliary_auth_info`. } ``` |

| Fields ||
|---|---|
| `idToken` | `string` ID token for the authenticated user. |
| `refreshToken` | `string` Refresh token for the authenticated user. |
| Union field `auxiliary_auth_info`. MFA verified sign-in information. `auxiliary_auth_info` can be only one of the following: ||
| `phoneAuthInfo` | ``object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v2/FinalizeMfaPhoneResponseInfo`)`` Extra phone auth info, including android verification proof. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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

## MfaTotpSignInRequestInfo

TOTP verification info for FinalizeMfaSignInRequest.

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

| Fields ||
|---|---|
| `verificationCode` | `string` User-entered verification code. |