Session Forwarding Setup for App Suite Teams
This document explains the session forwarding authentication mode (AUTH_MODE=session), the simplest way to authenticate users when Teams is deployed under the same domain as the App Suite host.
Overview
When Teams is served from the same domain as App Suite (for example, Teams at https://example.com/teams and the App Suite Middleware reachable under https://example.com/...), the user has already authenticated with the host. The browser holds an open-xchange-session* cookie, and the App Suite frontend exposes the opaque session token as ox.session.
In this mode Teams does not run any authentication of its own. It takes the user's existing App Suite session and forwards it to the Middleware, letting the Middleware be the source of truth for identity. There is no Keycloak, no JWT validation, no token exchange, no service account, and no server-side session storage.
This mirrors how the stock App Suite applications talk to the Middleware.
When to use it
Use session forwarding when:
- Teams is served under the same domain as App Suite (so the browser sends the
open-xchange-session*cookies to Teams), and - the Middleware is reachable from Teams at
APP_SUITE_API.
If Teams must authenticate users where there is no App Suite session (a standalone deployment, or a shared Keycloak realm), use Keycloak Token Exchange or the OIDC Authorization Code Flow instead.
Authentication flow
- The frontend sends each API request to Teams with
?session=<ox.session>and, because it is same-domain, the browser attaches theopen-xchange-session*cookies (credentials: include). - Teams resolves the user's identity by calling the Middleware
GET /user/mewith the forwarded session and cookies. A successful response (user_id,context_id) both authenticates the request and yields the user identity. An invalid or expired session is rejected by the Middleware, so Teams returns401. - Teams forwards subsequent Middleware calls (mail, folders, accounts) using the same session and cookies — no token exchange.
- The Yjs WebSocket carries the session as
?session=<ox.session>and is validated the same way.
Configuration
Only the Middleware URL is required.
Environment variables
# Enable session forwarding
AUTH_MODE=session
# App Suite Middleware API URL (the only auth-related requirement)
APP_SUITE_API=https://your-domain/appsuite/apiISSUER_ALLOWLIST, TOKEN_EXCHANGE_* and SERVICE_TOKEN are not used in this mode and the JWT plugin is disabled, so no OIDC_ISSUER is needed.
Helm values
authMode: session
appSuiteApi: https://your-domain/appsuite/apiThat's it — oidc.issuer, tokenExchange.* and serviceToken can be left unset.
Verification
Confirm Teams detected session mode:
curl https://your-domain/teams/api/config | jq .auth
# Should return: { "mode": "session" }Then open Teams as an authenticated App Suite user and confirm mailboxes load. Because the session is the user's own, a 401 from Teams means the App Suite session itself is missing or expired — the user re-authenticates with the host, not with Teams.
Limitations
- Same-domain only. If Teams is on a different domain, the browser will not send the
open-xchange-session*cookies and the forwarded session will be rejected by the Middleware. - No external submission. The external submission endpoint (ADR-0021) requires a JWT from a trusted issuer; with the JWT plugin disabled in this mode, that endpoint is unavailable.
References
- Configuration Reference
- ADR-0022: Session Forwarding Authentication Mode
- Keycloak Token Exchange (alternative mode)
- OIDC Authorization Code Flow (alternative mode)

