Repository navigation
byward v0.6.0
v0.6.0 gets downstream tokens beyond Entra, by RFC 8693 token exchange with Keycloak, plain OIDC providers and Auth0, and a remembered consent now tracks the lifetime its page showed. A value with an invisible character is now shown escaped wherever byward prints it. The store migrates forward, so back it up before you upgrade.
byward puts any MCP server, HTTP or stdio, behind OAuth 2.1 and your identity provider: Microsoft Entra ID first-class, and Okta, Keycloak, Google, Auth0 or any other OpenID Connect provider.
Pre-1.0, and no independent security audit yet. Read the security posture before deploying it.
A minor release on v0.5.0. No breaking changes.
Schema migrations
SQLite goes from schema v8 to v9, and PostgreSQL from v3 to v4, on first start (#727). Both migrations only add the columns that hold the lifetime a consent's page showed.
Back up first. Migrations are forward-only (ADR-0007). An older byward refuses the newer schema at startup, so rolling back the image alone does not work: a downgrade needs the backup taken before the upgrade. Back up the state directory (BYWARD_STORE_DIR) for SQLite, or the database for PostgreSQL.
Security
- A remembered consent records the lifetime its page showed (#727, #748). This closes v0.5.0's first Known gap.
- The gap: a consent used to record only that its page showed the grant's lifetime, not which lifetime. An operator who raised
BYWARD_REFRESH_TOKEN_LIFETIMElet a consent given under "up to 30 days" cover the longer grants without showing the page again. - Now: a remembered consent covers a request only while its recorded lifetime is at least what the page would show now. Otherwise the page is shown again, or
prompt=nonegetsconsent_required, both at/authorizeand again at the callback. - Both lifetimes count: raising
BYWARD_ACCESS_TOKEN_LIFETIMEalso shows the page again, for clients without therefresh_tokengrant. Lowering either lifetime keeps every consent. - Older consents (from v0.5.0 or earlier, or re-approved by an older replica during a rolling upgrade) recorded no lifetime. They read as 720 h, v0.4.1's fixed lifetime. An operator who never changes the settings sees no new pages.
- Upgrade note: if you lowered
BYWARD_REFRESH_TOKEN_LIFETIMEorBYWARD_ACCESS_TOKEN_LIFETIMEon v0.5.0 and will raise it after upgrading, runbyward revoke-allafter the upgrade, once every replica runs v0.6.0. Otherwise a consent remembered under the lower lifetime covers up to 30 days without the page, until its own 30 days end. Operators on the default lifetimes need do nothing.
- The gap: a consent used to record only that its page showed the grant's lifetime, not which lifetime. An operator who raised
- A value with an invisible character is shown escaped (#739, #749). This closes v0.5.0's Known gap for characters that Go counts as printable.
- The gap: a default-ignorable character that
strconv.IsPrintaccepts, such as U+034F, U+FE0F or U+3164, shows as nothing in a terminal. byward printed it raw, soad͏minread asadmin. - Now: byward escapes every such character, 267 code points from the Unicode 17.0.0 data, in
--print-config, the startup log,revoke-user's output, and both the text and JSON log. - The consent page: a client whose name is only such characters used to get a blank name. It is now named by its client ID, marked "(Not verified)".
- Not breaking: nothing that loaded before is refused.
- The gap: a default-ignorable character that
Features
- Downstream tokens by RFC 8693 token exchange, for OIDC IdPs (#746, #753; ADR-0033). Until now only Entra's On-Behalf-Of could get a downstream token. Now byward can exchange the user's IdP access token for a token for one downstream API. It delivers that token as On-Behalf-Of does: in
BYWARD_OBO_HEADERto an HTTP upstream, or on the token socket to a stdio upstream.- Keycloak and plain OIDC providers exchange with byward's sign-in client, authenticated by its secret or
private_key_jwt, or with an exchange client (below). - The exchange never sends the MCP client's token, the ID token or
resource. - Refusals map to the outcomes downstream tokens already have: the user lacks consent or access (
consent_required), byward's credential was refused (failed, with thecredential_rejectedalert), or the IdP is down (unavailable). No log line carries the IdP'serror_description. - A grant missing from discovery: if the IdP's discovery document doesn't list the token-exchange grant, byward warns once and doctor warns too. The exchange still runs.
- Run live against Keycloak 26.8.2. The Entra On-Behalf-Of regression run passed, and the Graph token was unchanged.
- Keycloak and plain OIDC providers exchange with byward's sign-in client, authenticated by its secret or
- Token exchange on Auth0, by an exchange client (#747, #776). Auth0 lets only a Custom API client exchange a token, and only a JWT for that client's API. So byward exchanges as a separate exchange client, and asks Auth0 at sign-in for a JWT for byward's own API. Run live on an Auth0 tenant: the upstream got the exchanged token, whose
actchain names the exchange client and then the sign-in client.
| Setting | With | What it does |
|---|---|---|
BYWARD_OBO_AUDIENCE |
Keycloak, Auth0, a plain OIDC provider | The downstream API as the IdP names it: a Keycloak client ID, an Auth0 API identifier. Setting it turns the token exchange on. Refused with Entra, Google and Okta. |
BYWARD_OBO_SCOPES |
the same | Plain scope names for the exchange. Keycloak requires the client scope that adds the audience. With Entra it keeps its meaning: scope URIs that turn On-Behalf-Of on. |
BYWARD_OBO_CLIENT_ID, BYWARD_OBO_CLIENT_SECRET_FILE |
Auth0 requires them; optional with the others | The exchange client, when the sign-in client does not make the exchange. On Auth0 it is the Custom API client of byward's Auth0 API. The secret is given as a file only. Set them together, and only with BYWARD_OBO_AUDIENCE. |
BYWARD_OIDC_AUDIENCE |
Auth0, required for the exchange | Sent as audience at sign-in, so the sign-in access token is a JWT for byward's Auth0 API. |
Startup refuses a configuration that cannot work, and names the fix: Google, which has no user token exchange; Keycloak without its client scope; Auth0 without the exchange client or without BYWARD_OIDC_AUDIENCE; scopes without an audience; and Okta, whose token exchange needs its NHI Authentication Tokens SKU and is not verified yet (#774).
Set it up with downstream APIs §6, Keycloak §6 and Auth0 §6.
Fixed
-
On-Behalf-Of answers
failedwhen Entra refuses byward's own client credential (#755, #757). Before, it answeredunavailableand told the user to try again shortly, for a fault only the operator can fix. It now answers as the token exchange does:failed, with thecredential_rejectedalert. The refusals areinvalid_client(AADSTS7000215, 7000222, 700016 and others) andunauthorized_client.- The
byward_downstream_tokens_totalmetric, the audit record and a stdio process's token socket now sayfailedfor this cause too. - Sign-in and refresh are unchanged: they still answer
unavailable(503 on refresh) and sign nobody out (ADR-0012 §6).
- The
-
Progress reaches its own request on the legacy stdio bridge (#754, #756). For 2025-11-25 clients, every upstream notification went to the oldest open request,
notifications/progressincluded. With two requests in flight:- a long call's progress stopped a quick call's timeout, so a hung quick call was no longer timed;
- the long call got the timeout answer while it was still reporting progress.
Now a progress notification goes to the request whose
progressTokenit carries. Everything else keeps the old route.
Docs
- mcp-clickhouse behind byward (#202, #767): each user queries with their own ClickHouse role.
- mcp-trino behind byward (#191, #768): every query runs in Trino as the signed-in user.
Internal:
- Tests now walk every stdio setting (#732, #750) and every HTTP upstream setting (#751, #758) from the settings registry to the adapter it configures, so a new setting that nobody wired fails CI.
- The endpoints reference's Methods column is generated from each route's 405
Allow(#738, #744). - Test helpers for the silent sign-in setup (#736, #745) and for the headers of an MCP POST (#759, #770).
- A rare race in the stdio lifecycle tests was fixed (#769, #772).
None of these changes behaviour.
Every change runs CI: unit and integration tests, PostgreSQL 15 and 18, the MCP SDK clients (TypeScript, Python, Go), MCP Inspector and the MCP conformance authorization suite.
Upgrading
- Back up the store: the state directory for SQLite, or the database for PostgreSQL. The schema migrates on first start, and an older byward refuses the newer schema, so a rollback needs this backup.
- Replace the binary or the container image. No setting changes. Run the new version's
byward check --offlineagainst your configuration if you want to confirm it. - If you lowered a token lifetime on v0.5.0 and will raise it after upgrading, run
byward revoke-allonce every replica runs v0.6.0 (see Security). - If you alert on
byward_downstream_tokens_total{outcome="unavailable"}for Entra: a refused client credential now counts asfailed.
Upgrading from v0.4.1 or earlier, read the v0.5.0 notes first: v0.5.0 has breaking changes.
Install
docker pull ghcr.io/byward-dev/byward:v0.6.0latest now points at v0.6.0. Verify the release as in packaging.
Known gaps
- Token exchange on Okta is refused until it is verified on an org with the NHI Authentication Tokens SKU (#774).
- The exchange client authenticates with a secret only.
private_key_jwtforBYWARD_OBO_CLIENT_IDis #775. - The audit log does not tie each MCP request to the user who made it (#773, planned for v0.7). It records sign-ins and token grants, with the user key.
- A consent remembered by v0.5.0 under a lowered lifetime covers up to 30 days after an upgrade that raises the lifetime again.
byward revoke-allcloses it (see Security). - A default-ignorable character outside a URL's host is accepted (#743). It changes no destination, and every log line and
--print-configescape it, butbyward init entra --upstream-urlwrites it raw into its script. An error message that names a file with Go's%qalso writes such a character raw (#657). - An opaque Bearer or Basic credential, pasted with its scheme into a setting that is not secret, is printed whole by
--print-config(#657). Logs redact it. - A secret with no documented prefix, pasted into a setting that is not secret, is still accepted and shown (#495). The likeliest is an Entra client secret given as an app role value.
- Two revocations can still be lost on a request that ends (#693): a reused refresh token within the grace that is not the latest one, and a
/revokewhose CIMD client's metadata or key fetch runs to its own 5 s timeout. Both are accepted, with the reasons in the security posture. - A span limit
OTEL_*setting that is not a number is printed with its value by the OpenTelemetry SDK, even with tracing off. - stdio upstream processes share byward's uid (#182). The operator isolates them by host settings, or separate containers or VMs.
The security posture lists the rest.
MCP is a trademark of LF Projects, LLC. byward is an independent project.