Skip to main content
Testkube 2.16.0 is out! Skills for AI Agents and Test Bundles, evals for AI Agents, A2A access, and much more! Read More

Reaching MCP Servers as the person asking

An AI Agent normally reaches an MCP Server as itself, with one key for everybody. The Through the identity provider sign-in changes who the server sees: your own identity provider turns whoever is asking into a token of its own, and the MCP Server authorizes that person rather than Testkube.

Two people asking the same AI Agent the same question then get different answers, because the server behind it already knows who may see what. Nobody enrols, and Testkube stores no key for that server.

Self-hosted only for now

This sign-in is available on self-hosted installations. The exchange requires your identity provider to reach your Testkube installation's Dex on every call, which a Testkube Cloud installation cannot offer across a customer boundary.

Who does what​

Setting this up takes two different people, and the split is the point of this page.

WhoWhat they do
Identity adminRegisters Testkube at your identity provider, trusts Testkube's Dex as a token issuer, decides how a Testkube subject maps to one of your users, and gives the agent a principal of its own.
Testkube organization adminEnters the relationship under Organization Management → AI & Governance → Identity provider, and sets one audience per MCP Server.
Testkube environment adminOptional. Declares a different provider for one Environment, under its AI Settings, Identity provider, when that Environment should not exchange at the organization's.
Platform or QA engineerPicks this sign-in on the AI Agent's MCP Server, once the two above are done.

Which MCP Servers this is for​

Use it for your own services: an internal build system, a deployment service, a data catalogue. They already validate tokens from your identity provider, so they can authorize the person the token names.

Keep third-party SaaS on Each person signs in. A service like Jira or GitHub trusts its own accounts, not your provider, so there is nothing for an exchange to produce. One installation will usually have both, and the sign-in is chosen per AI Agent and per MCP Server.

What your identity provider has to support​

The exchange is RFC 8693 token exchange, and support for it is uneven, so it is worth settling before planning the work. The question to put to your provider is narrow: can it exchange a token issued by an external issuer for one of its own? A provider that only exchanges tokens it minted itself cannot do this, however complete its token exchange support looks otherwise.

Two more things decide whether it is practical. The mapping from a Testkube subject to one of your users should be a rule rather than a record stored per person, or somebody has to be enrolled before they can ask anything. And the provider has to be able to issue a token for each MCP Server's own audience, so one server's token is not accepted by another.

PingFederate does all three. Its recipe is the worked example, and the shape it follows is a fair guide to what any provider will ask for.

Providers we have looked at​

Checked in November 2026, against the three points above. The last column is the part that matters: a product's own documentation is a weaker answer than a run, and both go stale when the vendor ships something, so take an untested row as a place to start rather than as an answer.

ProviderWhat we foundHow we know
PingFederateYes, all three. Mapping is configured once rather than per person.Run end to end, on 13.1.4.1
KeycloakOnly on its legacy preview path, and it needs a stored account link per person.Read its documentation
Microsoft Entra IDNo. No token exchange grant for an external issuer.Read its documentation
OktaNo, for the same reason.Read its documentation
OpenShift built-in OAuthNo.Read its documentation
Google WorkspaceFederates into Google Cloud only, not into your own services.Read its documentation
Auth0Yes, through Custom Token Exchange, on the paid tiers. An Action you write picks the user, so it is custom code rather than a rule.Read its documentation, not tested
PingOneProbably, it documents token exchange with external trusted issuers.Not tested, not confirmed
PingAM and PingOne Advanced Identity CloudProbably, it documents RFC 8693 and a trusted JWT issuer entity.Not tested, not confirmed
WSO2 Identity Server and AsgardeoProbably, it documents exchanging a federated token.Not tested, not confirmed
CurityOnly with a custom plugin, and the vendor's example is labelled a demo.Read its documentation, not tested

A provider that is not here is not a no. Put the three points above to it.

The trust direction that is easy to confuse​

Your installation may already use your identity provider for signing in to Testkube. That is the opposite direction from what this needs, and having one does not give you the other.

  • Signing in to Testkube: Testkube trusts your provider to say who a person is.
  • This sign-in: your provider trusts Testkube's Dex to say who a person is, so it can convert Testkube's token into one of its own.

So an identity admin registers Testkube's Dex as a trusted token issuer at the provider, with Dex's JWKS URL, and allows the registered client to exchange tokens from that issuer.

The JWKS URL is fetched on every exchange

Your provider reads Dex's signing keys over the network each time it converts a token, not once at setup. The provider must be able to reach your installation's Dex continuously, over HTTPS, and must trust the certificate authority that signed it. A provider that cannot reach Dex refuses every exchange.

How your provider recognises the person​

Testkube sends the OIDC ID token its own issuer minted for the person. Match them on that token's email claim. Its subject is an identifier internal to that issuer and names nobody in your directory, so a rule keyed on the subject matches nobody.

Your provider then has to turn that email address into one of its own users, and there are two ways it does that. The difference decides whether this is setup work or permanent work.

  • Attribute mapping, a rule configured once, which looks the person up by an attribute such as their email address. PingFederate works this way. Nothing is created per person and nothing has to be maintained as people join and leave.
  • A stored account link per person, a row the provider keeps for each individual. Keycloak works this way. Somebody has to create a link for every person who will use an AI Agent, and keep it in step with joiners and leavers. That is standing work in your estate, not part of the setup, and it is worth knowing before you commit.

Testkube refuses the exchange before it calls your provider when the token it holds for the person carries no email address, rather than presenting one that names nobody. Your provider is never asked to map an empty subject, which matters for the trap in the next section.

Validate against a real directory, not an empty realm​

A pilot on a test realm can pass while the real thing fails

Some providers silently create a shadow user for a subject they do not recognise, instead of refusing. On an empty test realm every exchange then succeeds, because every person is new, and the configuration looks correct.

Against your real directory the same configuration fails, because those people already exist and the provider has to match them rather than create them. Any validation has to run against a directory where the people are already there.

Runs with nobody present​

AI Triggers, pull request analysis and scheduled runs have no person to act for. They sign in as the AI Agent's own principal at your provider, not as the last person who used the agent.

This is the service account of the same client the exchange already requires, so your identity admin registers one thing rather than two. Give it only what those runs need: it is the identity your MCP Servers will see for everything nobody started.

If the client has no service account, those runs are refused and say so, rather than borrowing somebody's identity.

One audience per MCP Server​

Each MCP Server expects its token to name it as the audience, so your provider issues a token for that server and that server alone. A token minted for your build service is not accepted by your deployment service.

In Testkube, the organization admin lists the audience each MCP Server expects, by MCP Server id, under Organization Management → AI & Governance → Identity provider. At the provider, the registered client needs permission to request a token for each of those audiences.

One provider, or one per Environment​

The organization declares one provider and every Environment under it exchanges there. For most installations that is the whole of it.

An Environment can declare its own instead, and then every AI Agent in it exchanges at that provider rather than at the organization's. Nothing else about the exchange changes. This is what separate providers for production and development need: one relationship for the whole organization would mint both environments' tokens from the same client id and the same secret.

An environment admin declares it under that Environment's AI Settings, Identity provider. Until one is declared there, the page shows what the Environment inherits, marked Resolved from: The organization, so which provider answers is visible before anybody changes it. Audiences are set per MCP Server and MCP Servers belong to an Environment, so an Environment with its own provider lists its own audiences as well.

Removing the Environment's provider puts that Environment back on the organization's. Removing the organization's is not the same thing: it turns the sign-in off rather than falling back to anything else, and AI Agents then report that no identity provider is set up.

Setting it up​

  1. At your identity provider, register a client for Testkube with a client id and secret, trust your installation's Dex as a token issuer with its JWKS URL, allow that client to exchange tokens from it, decide how a subject maps to one of your users, give the client a service account for unattended runs, and allow it to request a token for each MCP Server's audience.
  2. In Testkube, open Organization Management → AI & Governance → Identity provider, and fill the form described below. Select Test connection: it asks your provider for a token as Testkube's own account, so a wrong secret or an unreachable endpoint shows up here rather than in somebody's chat. To give one Environment a provider of its own, do the same under that Environment's AI Settings, Identity provider.
  3. On the AI Agent, set the MCP Server's Sign-in to Through the identity provider.

The form​

FieldWhat goes in it
Token endpointYour provider's token endpoint, the one the exchange is posted to.
Client ID and Client secretThe client your identity admin registered for Testkube in step 1.
Testkube's issuer at your providerThe name your provider knows Testkube's Dex by, when it needs the issuer named rather than inferred. Leave it empty when your provider does not ask.
Subject token typeThe RFC 8693 type your provider's policy matches on. See below.
Audience per MCP ServerOne audience per MCP Server, by MCP Server id.
Subject token type decides which policy mapping runs

Left empty, Testkube sends urn:ietf:params:oauth:token-type:access_token. A provider that keys one mapping per subject token type then runs the mapping for that type, not the one you configured for a JWT, and the person is matched on the wrong claim or not at all. PingFederate works this way, and its recipe maps the email claim under urn:ietf:params:oauth:token-type:jwt, so enter that value for it.

Recipes​

A recipe is one provider configured end to end, with its own objects named as that provider names them. There is one today, PingFederate, and it is the best thing to read even for another provider: the five headings it is built on are the five decisions any provider makes you take.

When it does not work​

A server reached this way reports why rather than disappearing from the conversation, and the reasons are fixed in different places:

What the AI Agent reportsWhat it means
No identity provider is set upNothing is declared for this Environment or for its organization. An organization admin declares one, or an environment admin declares one for this Environment.
Your provider refused the sign-in itselfThe relationship is wrong: the client, the secret or the audience. An organization admin or your identity admin checks it.
Your provider would not issue a token for youYour provider does not recognise this person, or will not give them that audience. This is normal and personal, and it is your directory that decides.
Your provider could not be reachedA network or availability problem. Nothing is misconfigured.
Testkube holds no email address for youThe token Testkube holds for you carries none, so there is nobody to exchange. Sign in again, and if that does not help, whoever operates the installation checks that its sign-in asks for the email scope.

The provider's own wording is kept out of the chat, because it names internal configuration. It is written to the Control Plane log for whoever operates the installation, and the Test connection button shows it to the organization admin who can act on it.