# Authenticate OAuth

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

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

### Overview

Starts the OAuth login with another service. This is a browser redirect, not a call for a script: open it in the user's browser. It answers with a redirect to the login page of the service named in `provider`. When the user has approved, the service sends the browser back to the callback route of this API, `https://api.torbox.app/v1/api/integration/oauth/{provider}/callback`, which finishes the login.

The accepted providers and where the browser is sent:

- `google` -> `https://accounts.google.com/o/oauth2/auth`, asking for the scopes `https://www.googleapis.com/auth/drive.file` and `https://www.googleapis.com/auth/userinfo.email`
- `dropbox` -> `https://www.dropbox.com/oauth2/authorize`, asking for `files.content.write sharing.write`
- `discord` -> `https://discord.com/api/oauth2/authorize`, asking for `identify role_connections.write`
- `onedrive` -> `https://login.microsoftonline.com/common/oauth2/v2.0/authorize`, asking for `files.readwrite.all`
- `patreon` -> `https://www.patreon.com/oauth2/authorize`, asking for `identity`
- `apple` -> the Apple sign-in page, asking for `openid email`. Apple is asked to send the result back as a form POST.
- `anilist` -> `https://anilist.co/api/v2/oauth/authorize`
- `mal` -> `https://myanimelist.net/v1/oauth2/authorize`, asking for `write:users`
- `trakt` -> `https://trakt.tv/oauth/authorize`
- `simkl` -> `https://simkl.com/oauth/authorize`

Any other provider is answered with a JSON error instead of a redirect.

### Authorization

None required.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `provider` | path | string | yes | The service to log in 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
