Credential redemption
The MCPMCPModel Context Protocol: a standard way for AI agents to call tools and data sources exposed by a server./UCP service obtains the merchant access tokenMerchant access tokenA token issued by the merchant's own authorization server. Only the MCP/UCP service sees it, never the agent. through:
POST https://api.aigw.eval.loginid.ai/api/credentials/token
Request
Authorization: Bearer <AIGW_USER_ACCESS_TOKEN>
X-Proxy-Token: <PROJECT_PROXY_TOKEN>
Content-Type: application/json
{
"resource": "https://api.example.com/search"
}
Requirements observed/documented in the supplied implementation:
- both bearer contexts must belong to the same AIGW ProjectProjectThe isolation boundary for an integration. It holds Resources, agents and agent policy, end users, and Proxy clients.;
resourceis resolved against ResourcesResourceThe downstream system registered in a Project. Its kind (Token exchange or OAuth client) decides the role AIGW plays. in that Project;- it must match the Resource indicatorResource indicatorThe exact identifier (audience) of the merchant API. The MCP/UCP service sends the same value when redeeming the merchant token. configured on the Token exchange ResourceToken exchange ResourceA Resource for agent access: AIGW authorizes the user and obtains a token from the merchant's own authorization server.;
- missing required headers returned
400in the supplied test.
Token Vault/cache behavior
The current backend attempts external merchant-token provisioning during user login completion and caches the result by project, user subject, and Resource. Credential redemptionCredential redemptionPOST /api/credentials/token: the MCP/UCP service trades the user's AIGW token plus its Proxy token for the merchant access token. reads from that cache and refreshes lazily near expiry.
If the merchant supplied a refresh token, AIGW uses it; otherwise it re-runs the assertion/token acquisition flow.
A successful redeem against the newly configured demo Keycloak Resource was not executed in the supplied run, although the endpoint, error behavior, and backend flow were inspected.