Skip to content

EMA leg 3 requires a resource-AS client secret, which blocks public clients the redeem already supports #2725

Closed

Description

@ferentinai

mintEmaResourceTokens (core/auth/ema/emaFlow.ts) refuses to start the EMA mint unless resourceClientSecret is non-empty:

if (!config.resourceClientSecret?.trim()) {
  throw new Error(
    "EMA requires resource authorization server client secret in server OAuth settings (Test Client secret from xaa.dev resource registration)",
  );
}

But redeemIdJagForAccessToken, which it calls for leg 3, already handles a public client:

token_endpoint_auth_method: params.resourceClientSecret ? "client_secret_post" : "none"

So the guard rules out a case the redeem supports.

Impact: A resource authorization server that registers clients with token_endpoint_auth_method: none can't be used with EMA in Inspector. That covers any server that forces none at DCR, whatever the client asks for. The user gets an error pointing at xaa.dev, which isn't the resource AS in that case.

Reproduce (2.11.0):

  1. Register a client at a resource AS whose DCR returns token_endpoint_auth_method: none.
  2. In Server Settings, turn on Enterprise-managed authorization. Set Resource AS Client ID to that client and leave Resource AS Client Secret empty.
  3. Connect. It fails with EMA legs 2–3 (resource token mint): EMA requires resource authorization server client secret … before leg 2 runs.

Workaround: put any non-empty secret in the field. That only works if the AS ignores an unexpected client_secret on a public client. A strict AS would refuse it with invalid_client.

Suggested fix: drop the secret guard and keep only the resourceClientId check, so an empty secret goes through the existing none path. If a hint is still wanted, it belongs on an invalid_client response from the token endpoint, not before the request. The field's help text could also say the secret is optional for public clients.

Activity

  1. ferentinai commented on Oct 16, 2026

    @ferentinai
    Author

    Details the bug form would have asked for: v2 (2.11.0, latest), affected client core (core/auth/ema/emaFlow.ts; hit in Web), transport Streamable HTTP, macOS.

    Suggested prompt for the fix:

    In core/auth/ema/emaFlow.ts, mintEmaResourceTokens throws when resourceClientSecret is empty, but redeemIdJagForAccessToken already sends token_endpoint_auth_method: "none" when there is no secret. Remove the secret guard and keep the resourceClientId check, so a public resource-AS client can complete EMA leg 3. Add a test that an empty secret produces a leg-3 token request with no client_secret and auth method none, and update any test that asserts the old error. In the Server Settings EMA help text, say the Resource AS Client Secret is optional for public clients.

  2. added
    v2
    bug
    on Oct 20, 2026
  3. cliffhall commented on Oct 20, 2026

    @cliffhall
    Member

    Triage: Priority Medium (total 6)

    • Severity 3: EMA can't be used with a public-client resource AS. The workaround (a dummy secret) only works if the AS tolerates a stray client_secret.
    • Urgency 2: wanted eventually, and nothing is blocked on it.
    • Bonuses: +1 bug

    Board: #28, Status Incoming, awaiting maintainer review (no milestone yet).

  4. added this to the v2.12.0 milestone on Oct 20, 2026
  5. self-assigned this
    on Oct 20, 2026
  6. cliffhall commented on Oct 20, 2026

    @cliffhall
    Member

    Shipped in #2736 (merged to v2/main).

  7. added a commit that references this issue on Oct 26, 2026
    b089515
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions