Skip to content

0042: A 30-day session for the Claude connector ​

Context ​

ADR 0020 set the Access application session for GetMy Books MCP to 8 hours, so that a fresh sign-in (with MFA) is asked for every working day. ADR 0038 kept it at 8 hours.

In use, the Product Owner has to reconnect the Claude connector every day: the session ends, and the connector cannot renew past it, although the authorization server lists the refresh_token grant. Restarts, deploys and the nightly backup play no part: the app keeps no sign-in state, and Cloudflare Access holds the session.

A customer uses GetMy Books when there is work to do, such as the monthly bank check or the quarterly VAT return. That is every week or two, not every day. With 8 hours, nearly every use starts with a disconnected connector and a one-time code by email. The other connectors in the same Claude window (Gmail, Microsoft 365, Google Drive) stay connected for weeks, so ours reads as broken rather than secure.

The risk a short session guards against is someone else using a signed-in device. Whoever has a customer's unlocked laptop with Claude signed in almost always has their Xero and email open as well. The controls that limit what they can do stay in place: the Access policies and MFA for operators (ADR 0020), the principal and entity_access grant under row-level security, and no write to Xero without the owner pressing Approve on a preview card.

Decision ​

  1. The connector session is 30 days. The Access application GetMy Books MCP (mcp.getmy.group, team feaw) has a session duration of 720h. Its policies, identity providers and Managed OAuth settings (ADR 0012) do not change.
  2. The account pages go back to 8 hours, as a follow-up slice. Today that one application covers the whole hostname, so /billing, /account and /xero also get 30 days for now. A follow-up issue puts them under their own Access application with an 8-hour session and the same policies. The app then accepts that application's AUD on those paths, as it does for /admin with CF_ACCESS_ADMIN_AUD (ADR 0041). Until that ships, the risk to those pages is the same as to the connector: a signed-in device.
  3. Unchanged: the owners' view (/admin, 8 hours, ADR 0041), the sign-in applications (/signin/*, 8 hours, ADR 0038) and the docs site.
  4. Signing out everywhere. If a customer reports a lost device, or asks to be signed out of every device, an operator revokes that person's Access sessions: POST /accounts/{account_id}/access/organizations/revoke_user with {"email": "<their sign-in email>"}. Claude then asks them to sign in again. The follow-up slice checks that this also ends a connector that is already connected, and adds a line about it to the help pages.

Applied on 2026-10-19 ​

Through the Cloudflare API with the CLOUDFLARE_ACCESS_TOKEN in Doppler getmy-books/prd: PUT /access/apps/fa0ee84c-… (GetMy Books MCP) with the application's existing settings and session_duration: "720h". The result was compared with the saved settings from before the change. The only differences were the session (8h to 720h) and the order of the same four identity providers. The two policies (Named people, Entra with MFA, precedence 1; Self-service Sign-up, precedence 2) and the OAuth settings are unchanged.

At the time, the app container on the NAS had been up for 3 days with no restart, while the connector had still dropped every day. This confirms the session, not deploys, as the cause.

Follow-up slice, 2026-11-03 (issue #292) ​

Point 2 is built: the app checks the AUD of a second Access application, GetMy Books account pages, on /account, /xero and /billing when CF_ACCESS_ACCOUNT_AUD is set (SPEC-017 S21), and refuses the connector's token there. Until the Product Owner creates that application (8-hour session, the same identity providers and policies, no Managed OAuth) and sets its AUD in Doppler prd, those pages keep checking CF_ACCESS_AUD. The owner guide and SECURITY.md now say how to be signed out everywhere (point 4).

Still owed by the Product Owner: the revoke_user test of point 4. Revoke a test sign-in that has a connected Claude connector, and record here whether the connector was ended. Until then, this ADR does not claim that revoking ends a connector already connected.

Check ​

After the change, the connector should still be signed in the next morning, and again a week later. If it still drops at a fixed interval shorter than 30 days, the limit is in how Access handles the connector's refresh token, not in the session, and is looked at on its own.

Consequences ​

  • Owners and operators reconnect the connector about once a month, not every day.
  • A stolen, unlocked device keeps the connector working for up to 30 days, unless the session is revoked (point 4). The approval card still guards every write to Xero.
  • ADR 0020's "Application session: 8h" now applies to every GetMy Books application except GetMy Books MCP.