Skip to content

Add tutorial: Claude Workload Identity integration with Agent ID#6132

Open
ayshsandu wants to merge 10 commits into
wso2:masterfrom
ayshsandu:master
Open

Add tutorial: Claude Workload Identity integration with Agent ID#6132
ayshsandu wants to merge 10 commits into
wso2:masterfrom
ayshsandu:master

Conversation

@ayshsandu

Copy link
Copy Markdown
Member

Purpose

Add tutorial: Clade Workload Identty integration with Agent ID

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new tutorial documenting how agents registered in identity products can authenticate to Claude API using Anthropic Workload Identity Federation. The shared tutorial content provides setup steps, prerequisites, and two implementation examples (shell script and Python SDK), deployed across Asgardeo and Identity Server versions with product-specific configuration variables.

Changes

Agent ID to Claude API Authentication Tutorial

Layer / File(s) Summary
Shared Tutorial Content
en/includes/tutorials/agent-id-claude-authentication.md
Tutorial explains agent authentication flow through product identity → JWT issuance → Anthropic WIF exchange → Claude API access. Includes prerequisites, setup steps for OAuth application and federation rule configuration, Option A curl shell script with token exchange, sample Claude API call, and Option B Python SDK example with token provider caching.
Asgardeo Tutorial Wrapper, Index & Navigation
en/asgardeo/docs/tutorials/agent-id-claude-authentication.md, en/asgardeo/docs/tutorials/index.md, en/asgardeo/mkdocs.yml
Asgardeo variant sets product_name to "Asgardeo" and api_base_path using organization name, adds index entry, and registers navigation link.
Identity Server 7.2.0 Tutorial Wrapper, Index & Navigation
en/identity-server/7.2.0/docs/tutorials/agent-id-claude-authentication.md, en/identity-server/7.2.0/docs/tutorials/index.md, en/identity-server/7.2.0/mkdocs.yml
Identity Server 7.2.0 variant sets product_name to "WSO2 Identity Server" and api_base_path to https://localhost:9443, adds index entry with {{base_path}} templating, and registers navigation link.
Identity Server 7.3.0 Tutorial Wrapper, Index & Navigation
en/identity-server/7.3.0/docs/tutorials/agent-id-claude-authentication.md, en/identity-server/7.3.0/docs/tutorials/index.md, en/identity-server/7.3.0/mkdocs.yml
Identity Server 7.3.0 variant defines template variables and shared content inclusion, adds tutorial index entry, and registers mkdocs.yml navigation link.
Identity Server Next Tutorial Wrapper, Index & Navigation
en/identity-server/next/docs/tutorials/agent-id-claude-authentication.md, en/identity-server/next/docs/tutorials/index.md, en/identity-server/next/mkdocs.yml
Identity Server Next variant defines product_name and api_base_path, adds tutorial index entry, and registers navigation link.

Suggested labels

Team/API Access Mgt & Authorization

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete and largely off-topic. It merely repeats the (misspelled) PR title without providing the required Purpose, Related PRs, Test environment, or Security checks sections from the template. Complete the description by filling in all required template sections: Purpose (with issue links if applicable), Related PRs, Test environment, and Security checks.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the PR’s main change: adding a tutorial about Claude Workload Identity integration using Agent ID.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (1)
en/identity-server/7.3.0/mkdocs.yml (1)

1001-1001: ⚡ Quick win

Use sentence case and a shorter nav title for readability.

This title is long and title-cased. Consider sentence case with a shorter phrasing to improve scanability in the Tutorials menu.

✏️ Suggested wording
-    - Authenticate Agents with their own Agent ID to Claude API Using Workload Identity Federation: tutorials/agent-id-claude-authentication.md
+    - Authenticate agents with Agent ID using Claude API workload identity federation: tutorials/agent-id-claude-authentication.md

As per coding guidelines "Use sentence case for all headings and document titles" and "Use plain language and short sentences".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@en/identity-server/7.3.0/mkdocs.yml` at line 1001, Replace the long,
title-cased nav entry "Authenticate Agents with their own Agent ID to Claude API
Using Workload Identity Federation: tutorials/agent-id-claude-authentication.md"
with a shorter, sentence-case label while keeping the same target path; for
example use "Authenticate agents to Claude API using workload identity
federation" (or even shorter "Authenticate agents to Claude API") in the mkdocs
nav so it follows the sentence case and plain-language guidelines and improves
scanability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@en/asgardeo/docs/tutorials/index.md`:
- Line 16: Update the tutorial link text string "- [Authenticate Agents with
their own Agent ID to Claude API Using Workload Identity
Federation]({{base_path}}/tutorials/agent-id-claude-authentication/)" to use
sentence case to match the corrected tutorial title (e.g., "Authenticate agents
with their own agent ID to Claude API using workload identity federation") so
the visible link text follows sentence case while keeping the href unchanged.

In `@en/asgardeo/mkdocs.yml`:
- Line 742: Update the navigation entry string "Authenticate Agents with their
own Agent ID to Claude API Using Workload Identity Federation:
tutorials/agent-id-claude-authentication.md" to sentence case to match the
tutorial title (e.g., "Authenticate agents with their own agent ID to Claude API
using workload identity federation:
tutorials/agent-id-claude-authentication.md").

In `@en/identity-server/next/docs/tutorials/index.md`:
- Line 14: Update the markdown link text on the line containing "[Authenticate
Agents with their own Agent ID to Claude API Using Workload Identity
Federation]({{base_path}}/tutorials/agent-id-claude-authentication/)" to use
sentence case; replace the visible link text with "Authenticate agents with
their own agent ID to Claude API using workload identity federation" while
keeping the URL/mustache path unchanged so the target remains the same.

In `@en/identity-server/next/mkdocs.yml`:
- Line 1004: Update the navigation entry string "Authenticate Agents with their
own Agent ID to Claude API Using Workload Identity Federation:
tutorials/agent-id-claude-authentication.md" to sentence case to match the
corrected tutorial title (e.g., "Authenticate agents with their own agent ID to
Claude API using workload identity federation") so the nav entry exactly matches
the tutorial title and casing.

In `@en/includes/tutorials/agent-id-claude-authentication.md`:
- Line 1: Change the document title line "# Authenticate Agents with their own
Agent ID to Claude API Using Workload Identity Federation" to sentence case:
"Authenticate agents with their own agent ID to Claude API using workload
identity federation" so only the first word and proper nouns are capitalized;
update the heading text string at the top of the file accordingly.
- Line 139: The pip install line uses {{product_name}} which expands to display
names (with capitals/spaces) and produces invalid Python package names; update
the install command in en/includes/tutorials/agent-id-claude-authentication.md
to use proper package identifiers (match
en/includes/quick-starts/agent-auth-py.md) by replacing the current line "pip
install anthropic {{product_name}} {{product_name}}-ai" with either
product-specific lowercase package names (e.g., "pip install anthropic asgardeo
asgardeo_ai" for Asgardeo) or introduce and use new template variables like
{{python_package_name}} and {{python_ai_package_name}} that resolve to correct
values for each product.

---

Nitpick comments:
In `@en/identity-server/7.3.0/mkdocs.yml`:
- Line 1001: Replace the long, title-cased nav entry "Authenticate Agents with
their own Agent ID to Claude API Using Workload Identity Federation:
tutorials/agent-id-claude-authentication.md" with a shorter, sentence-case label
while keeping the same target path; for example use "Authenticate agents to
Claude API using workload identity federation" (or even shorter "Authenticate
agents to Claude API") in the mkdocs nav so it follows the sentence case and
plain-language guidelines and improves scanability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: d28edc67-153c-4201-8bff-79d16511ae4f

📥 Commits

Reviewing files that changed from the base of the PR and between 20dde91 and 1e4fdab.

📒 Files selected for processing (13)
  • en/asgardeo/docs/tutorials/agent-id-claude-authentication.md
  • en/asgardeo/docs/tutorials/index.md
  • en/asgardeo/mkdocs.yml
  • en/identity-server/7.2.0/docs/tutorials/agent-id-claude-authentication.md
  • en/identity-server/7.2.0/docs/tutorials/index.md
  • en/identity-server/7.2.0/mkdocs.yml
  • en/identity-server/7.3.0/docs/tutorials/agent-id-claude-authentication.md
  • en/identity-server/7.3.0/docs/tutorials/index.md
  • en/identity-server/7.3.0/mkdocs.yml
  • en/identity-server/next/docs/tutorials/agent-id-claude-authentication.md
  • en/identity-server/next/docs/tutorials/index.md
  • en/identity-server/next/mkdocs.yml
  • en/includes/tutorials/agent-id-claude-authentication.md

Comment thread en/asgardeo/docs/tutorials/index.md Outdated
Comment thread en/asgardeo/mkdocs.yml Outdated
Comment thread en/identity-server/next/docs/tutorials/index.md Outdated
Comment thread en/identity-server/next/mkdocs.yml Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
@pavinduLakshan pavinduLakshan changed the title Add tutorial: Clade Workload Identty integration with Agent ID Add tutorial: Claude Workload Identty integration with Agent ID Jun 17, 2026
@ayshsandu ayshsandu changed the title Add tutorial: Claude Workload Identty integration with Agent ID Add tutorial: Claude Workload Identity integration with Agent ID Jun 30, 2026
Comment thread en/asgardeo/docs/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/asgardeo/docs/tutorials/index.md Outdated
Comment thread en/asgardeo/mkdocs.yml Outdated
Comment thread en/identity-server/7.2.0/docs/tutorials/index.md Outdated
Comment thread en/identity-server/7.2.0/mkdocs.yml Outdated
Comment thread en/identity-server/7.3.0/docs/tutorials/index.md Outdated
Comment thread en/identity-server/7.3.0/mkdocs.yml Outdated
Comment thread en/identity-server/next/docs/tutorials/index.md Outdated
Comment thread en/identity-server/next/mkdocs.yml Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Comment thread en/includes/tutorials/agent-id-claude-authentication.md
Comment thread en/includes/tutorials/agent-id-claude-authentication.md Outdated
Co-authored-by: Pavindu Lakshan <pavindulakshan@gmail.com>
Comment thread en/identity-server/7.2.0/docs/tutorials/index.md Outdated
Comment thread en/asgardeo/mkdocs.yml Outdated
Comment thread en/asgardeo/docs/tutorials/index.md Outdated
Co-authored-by: Pavindu Lakshan <pavindulakshan@gmail.com>
Comment thread en/identity-server/7.2.0/mkdocs.yml Outdated
Co-authored-by: Pavindu Lakshan <pavindulakshan@gmail.com>
- [Secure Spring Boot API with WSO2 Identity Platform]({{base_path}}/tutorials/secure-spring-boot-api/)
- [Integrate WSO2 Identity Platform with SMART on FHIR healthcare apps]({{base_path}}/tutorials/smart-on-fhir/)
- [Secure Agentic AI Systems with WSO2 Identity Platform]({{base_path}}/tutorials/secure-agentic-ai-systems/)
- [Authenticate AI Agents with WSO2 Agent ID to Claude API Using Workload Identity Federation]({{base_path}}/tutorials/agent-id-claude-authentication/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title is stacked and not quite scannable. shall we make it shorter? I think the focus is on WSO2 Agent ID so shall we do

"Authenticate AI Agents to the Claude API with WSO2 Agent ID"

@@ -0,0 +1,233 @@
# Authenticate AI Agents with WSO2 Agent ID to Claude API Using Workload Identity Federation

This tutorial walks you through connecting an AI agent registered in {{product_name}} to the Claude API using [Anthropic's Workload Identity Federation (WIF)](https://docs.anthropic.com/en/docs/build-with-claude/workload-identity-federation/). By the end of this tutorial, your agent will authenticate with {{product_name}}, obtain a signed JWT, exchange it for a short-lived Claude access token, and make API calls without any static API keys.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This tutorial walks you through connecting an AI agent registered in {{product_name}} to the Claude API using [Anthropic's Workload Identity Federation (WIF)](https://docs.anthropic.com/en/docs/build-with-claude/workload-identity-federation/). By the end of this tutorial, your agent will authenticate with {{product_name}}, obtain a signed JWT, exchange it for a short-lived Claude access token, and make API calls without any static API keys.
This tutorial walks you through connecting an AI agent registered in {{product_name}} to the Claude API using [Anthropic's Workload Identity Federation (WIF)](https://docs.anthropic.com/en/docs/build-with-claude/workload-identity-federation/). By the end of this tutorial, your agent will authenticate with {{product_name}}, receive a signed JWT, exchange it for a short-lived Claude access token, and make API calls without any static API keys.

- `curl` and `jq` installed on your machine (for the shell-based approach).
- Python 3.9+ (for the SDK-based approach).

## Step 1: Register your AI Agent in {{product_name}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each step can benefit from having a small description as to why we are doing each step. Shall we do that?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants