# OAuth Callback Post

`POST https://api.torbox.app/v1/api/integration/oauth/{provider}/callback`

- Operation ID: `oauth_callback_post`
- Group: Integrations
- Auth: none

### Overview

The same callback as OAuth Callback Get, for a service that sends the browser back with a form POST instead of a GET. Apple does this: the login for `apple` asks for the result as a form POST, and this route reads the form fields `state` and `code` from it. It is reached by the browser on its way back from the service, not called by you.

TorBox exchanges the code for the service's tokens, looks up who the user is at that service, and redirects the browser to the TorBox website with the result in the query string:

`https://torbox.app/oauth/{provider}/success?token=...&expires_in=...&expires_at=...&user_id=...&id_token=...&nonce=...&refresh_token=...`

The query parameters are the ones described under OAuth Callback Get. For `apple`, `user_id` is the email address from Apple's ID token and `id_token` is that ID token. A value the service did not give is sent as the text `None`.

This route stores nothing on a TorBox account. If the login was cancelled, has expired or fails, the route answers with a JSON error instead of a redirect.

### Authorization

None required.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `provider` | path | string | yes | The service the login was started with. One of `google`, `dropbox`, `discord`, `onedrive`, `patreon`, `apple`, `anilist`, `mal`, `trakt` or `simkl`. |

## Responses

- `302` Found
- `400` Bad Request
- `404` Not Found
- `422` Validation Error
- `429` Too Many Requests
- `500` Internal Server Error
