An Azure Function that provides detailed information about an incoming HTTP request to demonstrate and debug credential delegation mechanisms used by AI agents.
When an AI agent calls a backend API on behalf of a user, it forwards a delegated access token (e.g., an On-Behalf-Of / OBO token) in the Authorization header. This function makes it easy to inspect that token and all other request metadata.
The function:
- Accepts an anonymous
HTTP POSTrequest on/api/HttpCallDetailsViewer. - Reads and displays all request headers, method, path, and query string.
- Extracts the
Bearertoken from theAuthorizationheader. - Base64-decodes the JWT payload and pretty-prints the claims as JSON.
- Returns everything as a styled HTML page.
| Property | Value |
|---|---|
| Trigger | HTTP |
| Methods | POST |
| Route | /api/HttpCallDetailsViewer |
| Authorization level | Anonymous (no function key required) |
An HTML page containing:
- Request information – HTTP method, protocol, path, query string
- Headers – all request headers as
Key: Valuepairs - Bearer token – the raw JWT string (if present in the
Authorizationheader) - Decoded token – the JWT payload decoded from Base64 and formatted as indented JSON
| Tool | Version |
|---|---|
| .NET SDK | 8.0+ |
| Azure Functions Core Tools | v4+ |
From the AbeckDev.AuthAgentSample.DebugFunction directory:
func startThe function will be available at:
http://localhost:7071/api/HttpCallDetailsViewer
Basic request (no token):
curl -X POST http://localhost:7071/api/HttpCallDetailsViewerRequest with a bearer token:
curl -X POST http://localhost:7071/api/HttpCallDetailsViewer \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."Save the response as an HTML file and open it:
curl -s -X POST http://localhost:7071/api/HttpCallDetailsViewer \
-H "Authorization: Bearer <your-jwt>" \
-o response.html && open response.htmlThe function returns an HTML page structured as follows:
HTTP Request Details
Request Information
Method: POST
Protocol: HTTP/1.1
Path: /api/HttpCallDetailsViewer
QueryString: (empty)
Headers
Content-Type: application/json
Authorization: Bearer eyJ...
Bearer Token
Token: eyJhbGciOi...
Decoded:
{
"aud": "api://my-app",
"iss": "https://login.microsoftonline.com/<tenant-id>/v2.0",
"sub": "user-object-id",
"name": "Jane Doe",
"roles": ["user"],
...
}
| File | Purpose |
|---|---|
host.json |
Azure Functions host settings (logging, Application Insights sampling) |
Properties/launchSettings.json |
Local run profile |
See the root README for full deployment instructions.