Operator OAuth clients
Configure built-in operator Google, GitHub, and Slack OAuth clients and the optional OAuth client metadata document on self-hosted Executor.
Self-hosted operators can pre-register Google, GitHub, and Slack OAuth applications in environment variables so members can connect those provider accounts without each user entering their own OAuth client credentials (Self-host only; Cloud provides managed clients and Local users enter their own credentials or use dynamic registration).
Set the matching EXECUTOR_OAUTH_<PROVIDER>_CLIENT_ID and EXECUTOR_OAUTH_<PROVIDER>_CLIENT_SECRET environment variables and register <BETTER_AUTH_URL>/api/oauth/callback (or your EXECUTOR_OAUTH_CALLBACK_URL) with each provider.
Prerequisites: A running self-host container (Self-host with Docker) with BETTER_AUTH_URL set, and developer/admin access to create OAuth apps in Google Cloud Console, GitHub, or Slack.
You’ll know it worked when the container starts without a FirstPartyOAuthClientsInvalid error and connecting a matching Google or GitHub provider account in the dashboard offers the configured operator client (Executor for Google or Executor for GitHub).
Callback URL
By default, every OAuth flow redirects back to:
<BETTER_AUTH_URL>/api/oauth/callback
Register that exact URL as the authorized redirect/callback URI in Google, GitHub, and Slack. To use a different callback URL, set EXECUTOR_OAUTH_CALLBACK_URL to the exact callback URL your instance serves.
Built-in operator OAuth clients
Executor defines three built-in operator client slots. Each slot turns on when you supply both its client ID and client secret. Setting only one of the pair fails startup.
| Provider | Display label | Environment variables | Token destination hosts |
|---|---|---|---|
| Executor for Google | EXECUTOR_OAUTH_GOOGLE_CLIENT_ID, EXECUTOR_OAUTH_GOOGLE_CLIENT_SECRET |
*.googleapis.com |
|
| GitHub | Executor for GitHub | EXECUTOR_OAUTH_GITHUB_CLIENT_ID, EXECUTOR_OAUTH_GITHUB_CLIENT_SECRET |
api.github.com, uploads.github.com, api.githubcopilot.com |
| Slack | Executor for Slack | EXECUTOR_OAUTH_SLACK_CLIENT_ID, EXECUTOR_OAUTH_SLACK_CLIENT_SECRET |
mcp.slack.com |
Google (Executor for Google)
- In Google Cloud Console, create an OAuth 2.0 Web application client and add
<BETTER_AUTH_URL>/api/oauth/callbackas an authorized redirect URI. - Enable the Google APIs your apps use and configure the OAuth consent screen for the scopes your apps request.
- Pass
EXECUTOR_OAUTH_GOOGLE_CLIENT_IDandEXECUTOR_OAUTH_GOOGLE_CLIENT_SECRETto the container.
Executor authorizes at https://accounts.google.com/o/oauth2/v2/auth and exchanges tokens at https://oauth2.googleapis.com/token (client_secret_post), requesting offline refresh tokens (access_type=offline, prompt=consent) with default scopes openid, email, and profile. On self-host, the allowed scope list covers the built-in Google Workspace, Calendar, Meet, Gmail (including https://mail.google.com/ and https://www.googleapis.com/auth/gmail.modify), Sheets, Drive, Docs, Slides, Forms, Tasks, Contacts/People, Photos, Search Console, YouTube, Google Ads, BigQuery, and Apps Script scopes. Tokens are sent only to *.googleapis.com. Executor does not call Google’s token revocation endpoint when a single account is removed (because Google revokes all grants for that client at once).
GitHub (Executor for GitHub)
- Create a GitHub App with User-to-Server OAuth enabled and set its callback URL to
<BETTER_AUTH_URL>/api/oauth/callback. Configure the repository and account permissions the app needs in GitHub. - Pass
EXECUTOR_OAUTH_GITHUB_CLIENT_IDandEXECUTOR_OAUTH_GITHUB_CLIENT_SECRETto the container.
Executor authorizes at https://github.com/login/oauth/authorize and exchanges tokens at https://github.com/login/oauth/access_token. Because GitHub Apps rely on app-level permissions rather than OAuth scopes (defaultScopes: []), Executor for GitHub is offered only to providers that declare no OAuth scopes. Its tokens are sent only to api.github.com, uploads.github.com, and api.githubcopilot.com.
Slack (Executor for Slack)
- Configure your Slack OAuth app with redirect URL
<BETTER_AUTH_URL>/api/oauth/callback. - Pass
EXECUTOR_OAUTH_SLACK_CLIENT_IDandEXECUTOR_OAUTH_SLACK_CLIENT_SECRETto the container.
Executor uses Slack’s user-token endpoints (https://slack.com/oauth/v2_user/authorize and https://slack.com/api/oauth.v2.user.access) with resource https://mcp.slack.com, sending tokens only to mcp.slack.com. Note that Executor for Slack is marked unlisted in beta.79: it is not shown when starting a brand-new account sign-in, and is used only to reconnect or renew existing grants that already use it.
OAuth client metadata document
For remote services that support OAuth Dynamic Client Registration, Executor registers a client automatically. For services (including many remote MCP servers) that instead accept a public OAuth Client ID Metadata Document, set:
EXECUTOR_OAUTH_CLIENT_METADATA_URL=https://executor.example.com/oauth/client-metadata.json
Executor then serves the metadata document at /oauth/client-metadata.json, listing a callback URL on that same origin (EXECUTOR_OAUTH_CALLBACK_URL if it shares the origin, otherwise /api/oauth/callback).
Turn this on only when <BETTER_AUTH_URL> is publicly reachable over HTTPS on the internet — remote OAuth servers fetch the metadata document directly. Clients your users already registered or entered remain in use when you enable it.
Example
Enable operator Google and GitHub OAuth clients alongside the OAuth client metadata document on a public HTTPS self-host instance:
docker run -d --name executor-v2 --init --restart unless-stopped \
-p 127.0.0.1:4400:4400 -v executor-v2-data:/app/data \
-e BETTER_AUTH_URL=https://executor.example.com \
-e EXECUTOR_OAUTH_GOOGLE_CLIENT_ID=1234567890-example.apps.googleusercontent.com \
-e EXECUTOR_OAUTH_GOOGLE_CLIENT_SECRET=GOCSPX-example-secret \
-e EXECUTOR_OAUTH_GITHUB_CLIENT_ID=Iv23liExampleClientId \
-e EXECUTOR_OAUTH_GITHUB_CLIENT_SECRET=example-github-secret \
-e EXECUTOR_OAUTH_CLIENT_METADATA_URL=https://executor.example.com/oauth/client-metadata.json \
ghcr.io/usefulsoftwareco/executor-selfhost:2.0.0-beta.79
Confirm the container started cleanly and serves the metadata document:
curl -sf http://127.0.0.1:4400/health
curl -sf http://127.0.0.1:4400/oauth/client-metadata.json
Limits
- Setting a client ID without its matching client secret (or vice versa) fails startup with
FirstPartyOAuthClientsInvalid. EXECUTOR_OAUTH_CLIENT_METADATA_URLmust be a publichttps://URL with a path and no query string, fragment, or embedded credentials; startup fails for loopback, private, or plain HTTP URLs or a different path on your own origin.- Executor for GitHub is offered only to providers that declare no OAuth scopes.
- Executor for Slack is
unlistedand does not appear as an option for new account sign-ins. - Google apps requesting a scope outside the built-in allowed list require users to supply their own Google OAuth client.