Skip to content

Embedded auth server consent page: expose upstream displayName in the VirtualMCPServer CRD, allow localized text, a theme, logo and custom CSS #7482

Backlog

Description

@nilsberberich

Summary

The consent page of the embedded authorization server ("Allow this app to sign you in?") is the one page every user of a vMCP gateway sees before the upstream IdP. For operators who run the gateway via the Kubernetes operator, nothing on that page can be adapted:

  1. The line "You will sign in with … next." shows the upstream's name, a routing key such as corp-idp. Show a display name for upstreams on the embedded auth server consent page #6922 added DisplayName for exactly this, but the VirtualMCPServer CRD does not expose it, so operator deployments cannot use it.
  2. All text is English and hard-coded (consentPageTemplate, classifyRedirect), with lang="en" and "ToolHive" in the title. Our users are German speakers who do not know ToolHive.
  3. The layout is fixed: colours and markup are built in (pageStyles, consentStyles, consentPageTemplate), no logo can be added, and the CSP only allows those two style blocks by hash. The page looks like a different product than the company sign-in that follows it.

The page is a security control: it asks the user to check where the sign-in is sent and to deny if they did not just start the app. That only works if users understand the page. A page in a foreign language that names an internal key and an unknown product trains users to click "Approve" without reading.

Rewriting the page in a reverse proxy is fragile and touches a security-sensitive flow (handle, browser binding cookie, Origin check, CSP), so we would rather not do that.

Proposal

Part 1 (small): displayName in the CRD

Add an optional displayName to spec.authServerConfig.upstreamProviders[] and pass it through to UpstreamRunConfig.DisplayName. Semantics as in #6922: display only, never a key, same sanitising and length cap. With no displayName the page stays as today.

authServerConfig:
  upstreamProviders:
    - name: corp-idp
      displayName: "Corporate sign-in"
      type: oidc

Acceptance: a VirtualMCPServer with displayName: "Corporate sign-in" renders "You will sign in with Corporate sign-in next." and keeps corp-idp under Technical details.

Part 2: localized text for the consent page

Let the operator provide the page text, without changing structure or security behaviour:

  • A fixed set of message keys (heading, summary texts from classifyRedirect, labels, "not verified" hint, remember checkbox and help text, buttons, page title). Values are plain text, rendered through html/template as today; no HTML, no extra CSS, so the CSP stays as it is.
  • Shipped catalogs at least for en (default, today's text). The operator selects a locale, e.g. authServerConfig.consentPage.locale: de once a German catalog ships (we would contribute it), optionally with a ConfigMap reference for custom or additional catalogs. A missing key falls back to English.
  • lang attribute follows the selected locale.
  • Optional: a product name for the title instead of "ToolHive".

What Part 2 does not change: which facts are shown (destination, client name marked as not verified, technical details), form fields, CSP, Origin and binding checks. Security-relevant messages (the "only continue if you just started that app" warning and the "not verified" hint) must not be empty: an empty or missing value falls back to the shipped text. If you prefer, these keys could also be limited to shipped, reviewed catalogs.

Part 3: custom layout (theme, logo, optional custom stylesheet)

We would also like the page to look like the rest of our sign-in (company colours and logo), so users recognise it as part of the same flow. The shared pageStyles already uses CSS custom properties (--brand, --bg, --card, …, in v0.73.0 and v0.74.0), which makes a theme cheap.

Trust model: the operator is trusted. The page protects users against unknown DCR clients, not against the operator. The remaining risk is an operator hiding a warning by mistake, so the proposal is narrow by default, with one explicitly trusted escape hatch:

  • Theme values, not a free stylesheet: the operator sets values for an allowlist of the existing variables (light and dark), e.g. authServerConfig.authPages.theme.brand: "#0b5cad". Values are validated (colours only), and the generated :root block is hashed at startup like the existing style blocks. Selectors, content:, display and url() cannot be set this way, so with theme values alone the warning, the "not verified" marker and the technical details cannot be hidden or changed by styling. This should be the recommended way.
  • Custom stylesheet (operator-trusted option): for layouts the variables cannot express (spacing, card width, header with logo, button shapes), an optional stylesheet from a ConfigMap, e.g. authServerConfig.authPages.styleConfigMapRef, with a size limit, appended after the built-in styles and hashed at startup like them (no 'unsafe-inline'; a change takes effect after a restart). This is explicitly operator-trusted: a stylesheet can hide, relabel or move any element, including the destination, the warning, the "not verified" marker, the technical details, the remember checkbox and the buttons. With a custom stylesheet active, the guarantee from Part 2 covers the text but not its visibility. Write access to that ConfigMap therefore equals write access to the consent page (RBAC). The documentation should say so, and the server could log a warning at startup when a custom stylesheet is active.
  • Logo: optional, shown above the heading, supplied as an image (PNG or SVG as data: URI, with a size limit).
  • CSP: the consent page already sends default-src 'none'; style-src 'sha256-…'; frame-ancestors 'none'; base-uri 'none'. Part 3 only adds the hash of the theme block, the hash of an optional stylesheet and img-src data:. Because default-src 'none' stays, external url(), @import and fonts (also data: fonts) remain blocked, so neither theme nor stylesheet can make the user's browser contact other hosts or track sign-ins. Acceptance: a stylesheet with an external url() triggers no request. All other headers (X-Frame-Options, no scripts) stay unchanged.
  • Scope: consent page. Applying the same theme to the device verification page could be a separate, opt-in setting, as company branding there also makes device-code phishing look more credible; the client facts and warnings would stay fixed there in the same way.

A full HTML template override would give more freedom, but a presence check cannot ensure that required elements are visible, and it would add maintenance load. We do not ask for it here.

If you prefer, the parts can be separate issues; Part 1 is independent and much smaller.

Environment

  • ToolHive operator and vMCP v0.73.0; the same code is in v0.74.0 and on main (checked 2026-12-03)
  • Embedded auth server with several upstream providers, clients registered via DCR (Claude desktop app and others), so the consent page is shown on every new sign-in that is not remembered.

Activity

  1. added
    needs-triage
    enhancement
    kubernetes
    vmcp
    on Dec 3, 2026
  2. nilsberberich commented on Dec 3, 2026

    @nilsberberich
    ContributorAuthor

    I'd like to work on this. I would start with Part 1 (displayName in the CRD), as it is small and independent, and send it as a separate PR. For Parts 2 and 3 I'd wait for your feedback on the proposed design before implementing anything. Happy to split them into separate issues if that suits you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationenhancementkubernetesneeds-triageoauthoperatorsecurityvmcp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions