# How to Connect Discord and Google Accounts to X02

> A complete guide to linking your Discord and Google accounts with X02 for seamless 1-click logins, bot integrations, and secure account management.

Source: https://x02.me/blog/how-to-connect-discord-and-google-accounts · 2026-09-01 · X02 Team

Managing passwords across dozens of services is tedious. To make accessing your files and media library fast and effortless, **X02 supports Account Connections for Discord and Google**.

By linking your Discord or Google accounts, you unlock:
* **1-Click Social Login:** Sign in instantly with one click on any browser or phone without typing your password.
* **Account Recovery:** Never get locked out if you forget your local password.
* **Discord Bot & Ticket Integration:** Seamlessly sync your Discord identity for server ticket moderation and bot management.
* **Flexible Multi-Auth:** Connect multiple login methods to a single unified dashboard and disconnect them anytime.

> [!TIP]
> **Quick Navigation:**
> * [How to Link Discord](#linking-your-discord-account)
> * [How to Link Google](#linking-your-google-account)
> * [How to Disconnect Accounts](#how-to-disconnect-a-linked-account)
> * [OAuth 2.0 Security & Architecture (For Devs)](#part-2-the-developer--power-user-guide)
> * [Next Steps & Related Tutorials](#next-steps--related-tutorials)

---

## Part 1: The Easy Guide (For Everyone)

Linking your social accounts takes less than 10 seconds directly from your dashboard.

![Architecture Diagram](/blog-diagrams/how-to-connect-discord-and-google-accounts-1.svg)

---

### Linking Your Discord Account

| Where to Go | Direct Link | Action |
| :--- | :--- | :--- |
| **`Dashboard`**  **`Settings`**  **`Account Connections`** | [Open Dashboard Settings](https://x02.me/dashboard) | Click **Connect Discord** |

1. **Log in** to your account at **[x02.me](https://x02.me)** and open your **Dashboard**.
2. Navigate to **Settings** and find the **Account Connections** section.
3. Next to **Discord**, click **Connect Discord**.
4. A secure Discord authorization window will appear. Click **Authorize**.

Once approved, you will see a green **Linked** badge. You can now use the **Continue with Discord** button on the login screen anytime.

---

### Linking Your Google Account

1. Go to **Dashboard**  **Settings**  **Account Connections**.
2. Next to **Google**, click **Connect Google**.
3. Choose your Google account in the secure popup.
4. Confirm authorization.

Your Google account is now linked, enabling 1-click **Continue with Google** sign-in.

---

### How to Disconnect a Linked Account

If you want to unlink a Discord or Google profile from your X02 account:

1. Open **Dashboard**  **Settings**  **Account Connections**.
2. Click **Disconnect Discord** or **Disconnect Google**.
3. Confirm the action.

> [!NOTE]
> **Your Files Are Always Safe:** Disconnecting a social account never deletes your uploaded files, custom subdomain settings, or API keys. You can always reconnect at any time or log in using your standard username and password.

---

## Part 2: The Developer & Power User Guide

For developers curious about how authentication and account linking are handled behind the scenes:

---

### 1. OAuth 2.0 Flow Under the Hood

X02 follows the standard OAuth 2.0 authorization code grant flow:

![Architecture Diagram](/blog-diagrams/how-to-connect-discord-and-google-accounts-2.svg)

1. **CSRF State Verification:** When linking from the dashboard, a cryptographically random `state` parameter prevents cross-site request forgery attacks.
2. **Account Association:** The provider's unique ID (`discordId` or `googleId`) is securely stored in your user database record alongside verified email metadata.
3. **No Password Sharing:** X02 never accesses, sees, or stores your external Discord or Google passwords.

---

### 2. Disconnecting Accounts via REST API

If you are managing user sessions programmatically:

#### Disconnect Discord Endpoint:
```bash
curl -X POST "https://x02.me/api/discord/disconnect" \
  -H "x-api-key: YOUR_X02_API_KEY" \
  -H "Content-Type: application/json"
```

#### Disconnect Google Endpoint:
```bash
curl -X POST "https://x02.me/api/google/disconnect" \
  -H "x-api-key: YOUR_X02_API_KEY" \
  -H "Content-Type: application/json"
```

#### Successful JSON Response:
```json
{
  "success": true,
  "message": "Account disconnected successfully"
}
```

---

### 3. Discord Bot & Ticket System Synchronization

Linking your Discord account directly pairs with the **X02 Discord Ticket System** (`/discord-tickets`). 

When linked:
* The web ticket dashboard automatically detects which Discord servers you manage.
* Ticket creation buttons, staff response forms, and HTML transcripts are automatically attributed to your Discord user identity.

---

## Security Best Practices

| Recommendation | Why It Matters |
|---|---|
| **Enable 2FA on Google & Discord** | Because social login gives instant access to your X02 dashboard, protecting your linked accounts with Two-Factor Authentication secures your file library. |
| **Keep a Backup Password** | Setting a strong local password ensures you can always sign in even if an external provider experiences temporary downtime. |
| **Review Connected Apps Periodically** | Periodically check your Account Connections in settings to remove unused or old third-party logins. |

---

## Next Steps & Related Tutorials

| What to learn next | Guide Link |
| :--- | :--- |
| **Get your personal API key for scripts & tools** | [How to Get an API Key ](/blog/how-to-get-an-api-key) |
| **Integrate ShareX for instant screenshot uploads** | [How to Integrate ShareX with X02 ](/blog/how-to-integrate-sharex-with-x02) |
| **Switch between Short URLs and Subdomains** | [How to Switch Between Short URLs and Subdomains ](/blog/how-to-switch-between-short-urls-and-subdomains) |
| **Organize your media with custom folders** | [How to Organize Files with Folders ](/blog/how-to-organize-files-with-folders) |
