# Finish a provider sign-in

`GET /api/v1/auth/providers/{provider}/callback`

Where the provider sends the browser back. Finishes the sign-in and redirects to the dashboard; never JSON.

Sign-in: none.

Section: Sign-in and account. Operation id in openapi.json: `finish_provider_sign_in`.

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `provider` | path | yes | string | `google` or `github`. |
| `state` | query | no | string | The value the sign-in started with, as the provider sends it back. |
| `code` | query | no | string | The provider's authorization code. |
| `error` | query | no | string | The provider's refusal (`access_denied` when the person cancelled). |

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 303

To the dashboard: the next page, the TOTP step or the error

### 400

Bad Request.

- `request.malformed`: the body or a parameter is not of the expected shape
- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 404

Not Found.

- `request.not_found`: it does not exist, or you cannot see it

### 422

Unprocessable Entity.

- `field.invalid`, `field.required`: a parameter breaks a rule; `errors` points at it

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
