Skip to content

Integrations OAuth Administration Runbook

Register one OAuth application per deployment, store its client material in Vault, and verify the callback and token lifecycle before connecting a provider.

Admin guide Β· OAuth runbook

When to use Before you start Steps Verify Roll back
Connecting Google, Microsoft or Meta providers Vendor admin access, Vault write access Register, store, authorize, review scopes Callback works, token in Vault only Delete the connection row and revoke the grant

When to use

Use this runbook when an integration must act on behalf of a user, or when an OAuth connection fails after a vendor or deployment change.

Before you start

  • One application per deployment. A single public client id shared across deployments mixes redirect URIs and token audiences; create a separate registration for each deployment.
  • OAuth connections are rows in botintegrations with a vault_path; credentials are loaded from Vault at use time (handlers_lifecycle.rs) and never enter the LLM context.
  • The stable callback is GET /api/integrations/oauth/:provider/callback; a bot-scoped variant is /api/bots/:bot_id/integrations/oauth/:provider/callback (botintegrations/src/routes.rs).
  • The vendor setup steps are in botserver/src/apps/integration_catalog/auth_steps.rs: Google Cloud Console for Google, Microsoft Entra for Microsoft Graph, Meta developer portal for Instagram and Facebook Pages.

Steps

# 1. Register the application with the vendor and add this deployment's
#    callback URL to the allowed redirect URIs.

# 2. Store the client id and secret in Vault under the connection's
#    vault_path. Never put them in config.csv or .env.
source <(grep -E '^VAULT_' "${WORKSPACE}/.env")
export VAULT_ADDR="$VAULT_ADDR"
export VAULT_CACERT="${WORKSPACE}/botserver-stack/conf/system/certificates/ca/ca.crt"
export VAULT_TOKEN=$(cat /tmp/vault-token-gb 2>/dev/null || echo "$VAULT_TOKEN")
VAULT_BIN="${WORKSPACE}/botserver-stack/bin/vault/vault"

# 3. Start the authorization flow from the Integrations app and approve only
#    the scopes required by the actions you enabled.

# 4. Review the granted scopes after connecting; revoke and reconnect if
#    broader access was approved.
grep -iE "oauth callback|scope validated|ERROR" botserver.log | tail -30

Verify

Check Surface Pass condition
Callback GET /api/integrations/oauth/:provider/callback authorization completes
Vault connection row's vault_path client material present in Vault only
Scopes vendor consent screen only the required scopes granted
Token lifecycle connection status token refresh works without a new consent
Logs botserver.log scope validation logged, no secret printed

Troubleshooting

Symptom Cause Action
redirect_uri_mismatch callback not registered for this deployment add the exact callback URL at the vendor
Token rejected client material stored outside Vault move it to the vault_path
Too-broad access over-broad consent revoke and reconnect with fewer scopes

Roll back

πŸ”΄ Delete the integration connection through the documented surface and revoke the grant at the vendor, then remove the Vault entry only after confirming no other connection uses it. Record a leaked token through incident response.