---
title: "Connections (per-user OAuth2)"
description: "AiHummer Connections let each user authorize a third-party app over OAuth2, store the token in the vault and resolve it by the acting user."
updated: "2026-11-17"
---

**Connections** are how an individual user grants AiHummer access to a
third-party service on their own behalf. Instead of a single shared service
account, each person runs a standard **OAuth2 authorization-code flow**, the
resulting token is sealed in the encrypted vault, and at turn time the runtime
resolves *that user's* token when a tool needs it.

This is the "personal" half of AiHummer's credential model. For the broader
picture — when to prefer a shared credential and how the fallback works — see
[Personal vs shared credentials](/en/v1.7/access/personal-vs-shared/).

The personal flow below remains the default. After signed Core 1.4.15 is installed, a configured channel and native tools can select one existing, explicitly bound credential, with a dedicated `connection-token` key and the vault as the sole refresh owner. This does not share all users' grants or require each employee to connect. Tools still check the acting user's current rights. See [Bitrix24](/en/v1.7/channels/bitrix24/).

## What a Connection is

A Connection binds three things together: a **provider** (the OAuth2 app you are
authorizing against), a **user** (the person who completed the consent screen),
and a **vault entry** (where the issued token is stored). Once established, any
tool that acts on behalf of that user can transparently use the token without it
ever appearing in the model context, in logs or in the prompt.

Connections are managed from the admin UI. The list shows each user's connected
providers, their status and when they were last refreshed.

## The authorization-code flow

A Connection is created with the canonical three-legged OAuth2
authorization-code grant:

1. The user starts a connection for a provider from the admin UI — a
   `POST`/`GET /v1/admin/connections/oauth/start` request.
2. AiHummer redirects the browser to the provider's **authorization** endpoint
   with the requested scopes.
3. The user approves the consent screen; the provider redirects back with a
   one-time **authorization code** to `/v1/admin/connections/oauth/callback`.
4. Inside the callback handler, AiHummer exchanges that code server-side for an
   **access token** (and, when the provider supports it, a **refresh token**)
   at the *provider's* token endpoint.
5. The token is written to the vault and the Connection is marked active.

The code-for-token exchange happens server-side inside the callback, so the
client secret and the issued token never leave the gateway.

> [!NOTE]
> Do not confuse this flow with `POST /v1/oauth/token`: that is AiHummer's
> **own** OAuth2 client-credentials endpoint — service accounts registered via
> `/v1/admin/apikeys/register-client` exchange their `client_id`/`client_secret`
> there for a short-lived `ah-` token. It has nothing to do with third-party
> Connections.

> [!NOTE]
> The authorization-code flow always involves a real browser consent step. A
> Connection cannot be created head-less from an API key alone — the acting user
> must approve the scopes once.

## Where the token lives

The issued token is stored in AiHummer's **encrypted credential vault**, not in
plain configuration. The vault uses envelope encryption (AES-256-GCM with a
per-tenant data key under a master key), and secrets are never copied into the
model context, prompts or logs. A revoked or expired Connection simply leaves no
usable secret behind.

```text
oauth/start ─▶ consent ─▶ code ─▶ oauth/callback (exchange at the provider) ─▶ access/refresh token ─▶ vault (encrypted)
```

## Resolved by the acting user

The defining property of a Connection is that it is **resolved by the acting
user**. When an agent runs a tool that needs the provider, the runtime looks up
the Connection belonging to the user on whose behalf the turn is running, and
uses *their* token. Two employees talking to the same agent therefore act with
their own authorizations and see only what their own grant allows.

This is what makes Connections suitable for personal, per-user integrations:
each person's access is isolated, auditable and individually revocable.

## Available integrations

The services below support personal connections. Starting OAuth requires the provider configuration on this server.

| Group | Services |
|---|---|
| **Google** | Gmail, Google Calendar, Google Contacts, Google Tasks, Google Drive, YouTube |
| **Microsoft** | Outlook Mail, Outlook Calendar, OneDrive, Microsoft To Do |
| **Productivity** | Todoist, Asana, Jira Cloud, ClickUp, GitLab, Linear, monday.com |
| **Health & lifestyle** | Fitbit, Oura Ring, Strava, Spotify, Samsung SmartThings |

For an available OAuth connection, complete the provider consent screen. The issued token is stored in your vault and selected when a tool uses that service.

## Personal Gmail when OAuth is unavailable

If Gmail OAuth is unavailable, ask the agent for the personal Gmail setup link. Open it while signed in to the AiHummer account for which it was created. For an account mismatch, sign in to that account and reopen the link. The form saves a separate private connection alongside the agent mailbox.

Create a Google app password in your Google account settings with 2-Step Verification enabled and an eligible account. Enter your Gmail address and the generated app-specific password directly in the form. IMAP/SMTP settings are automatic. [App password settings](https://myaccount.google.com/apppasswords) · [Google Account Help](https://support.google.com/accounts/answer/185833).

Ask the agent to read your personal Gmail after saving. The `mail` tool selects personal Gmail with `account=personal_gmail` and the agent mailbox with `account=agent`. Each operation checks current access and the selected credential. Saving confirms storage. A successful read confirms access. Sending requires your instruction. For an unconfirmed send, inspect its original receipt before another attempt.

## Managing connections in the admin UI

From the admin UI an operator can:

- See which providers each user has connected and the health of each token.
- Start a new connection (kicking off the consent flow for a chosen provider).
- Revoke a connection, which removes the vault entry and disables resolution.

Connections are either **personal** (owned by a specific user, who can
disconnect them) or **shared with the workspace** (tagged "Workspace shared"; they cannot
be disconnected personally). One provider can hold **multiple accounts**: the
"+ account" button asks for a label and vaults another credential of the same
provider — e.g. several Google calendars or mailboxes.

Because the underlying credentials are personal, a Connection is most often the
right tool when an action must be attributed to, and constrained by, a specific
human's authorization rather than a workspace-wide account.

## Where to next

- [Personal vs shared credentials](/en/v1.7/access/personal-vs-shared/) — the full
  scope model and when to choose each.
- [BYOK LLM providers](/en/v1.7/access/byok-providers/) — bring your own model keys
  per tenant.
- [Marketplace overview & tiers](/en/v1.7/marketplace/overview-tiers/) — where
  OAuth-backed integrations fit.
