← Back
AWS ML Blog

ServiceNow on-behalf-of token exchange with Bedrock AgentCore Gateway

•12 min read•
#agents#bedrock
Level:Advanced
For:AI Engineers
✦TL;DR

This article details how to configure Amazon Bedrock AgentCore Gateway to perform an on‑behalf‑of (OBO) token exchange with Microsoft Entra ID, enabling an AI agent to call the ServiceNow REST API while preserving the original user’s identity. The gateway receives a JWT scoped to the agent’s client ID (e.g., 3ff88e17‑XXXX‑…) and exchanges it for a new token whose audience matches the ServiceNow API connector client ID (e.g., 5d4a7a11‑XXXX‑…) using the requested_token_use: on_behalf_of parameter. Engineers can apply this pattern to any OAuth‑protected REST API and combine it with Bedrock Guardrails for content safety.

⚡ Key Takeaways

  • The OBO flow uses the requested_token_use: on_behalf_of parameter when calling the Entra token endpoint.
  • Audience claims must be swapped from the agent’s client ID (e.g., 3ff88e17‑…) to the ServiceNow API connector client ID (e.g., 5d4a7a11‑…).
  • Identity propagation preserves the preferred_username claim, allowing ServiceNow to enforce user‑level permissions.
  • Configuration occurs on the AgentCore Gateway target, which handles the token exchange on each request.
  • Prerequisites include an AWS account with AgentCore Gateway access, a Microsoft Entra ID tenant with Application Developer role, and a ServiceNow instance with inbound OAuth integration.
💡 Why It Matters

Preserving user identity across AI‑driven workflows eliminates audit gaps and enforces least‑privilege access, making it safe to embed agents in enterprise automation pipelines.

✅ Practical Steps

  1. Configure the AgentCore Gateway target to perform OBO token exchange, specifying the ServiceNow API connector client ID as the target scope and setting requested_token_use to on_behalf_of.
  2. Ensure the AI agent presents a JWT whose audience claim matches its own client ID when invoking the gateway.
  3. Verify that ServiceNow’s inbound OAuth integration trusts the exchanged token and maps the preferred_username claim to an existing ServiceNow user.

Want the full story? Read the original article.

Read on AWS ML Blog ↗

More like this

Introducing Gemini 4 Neon

Google DeepMind•#llm

DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency

Hugging Face Blog•#llm

Mathematical proof, powered by AI. And no hallucinations!

Amazon Science•#agents

AI’s GPU focus meets a CPU reality check at Dell and AMD

SiliconANGLE AI•#agents

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING