Identity Investigation Playbook
Technical

Identity Investigation Playbook

by David Simpson · 2026-08-23

Practical investigation and response to identity-based cyber attacks

40 chapters 22,472 words ~90 min read English 97 reads

Read the first chapter

The whole of chapter one, free. About 3 min. Turn the pages with the arrows, your keyboard, or a swipe.

Chapter 1

OAuth 2.0 Authorization Code Flow

Overview

Could a valid authorization code be enough to take over an account? In OAuth 2.0, it can be when an attacker captures the code and defeats redirect URI validation. This reference covers the Token Trail Map: trace the authorization request, redirect, code exchange, and resulting tokens to determine whether redirect URI abuse caused account compromise.

Quick Reference

| Stage | Method | Endpoint or artifact | Investigation value | |---|---|---|---| | Authorization | GET | /authorize | Identify client, redirect URI, scope, and user session | | Code delivery | Browser redirect | redirect_uri?code=... | Determine whether the code was exposed or altered | | Token exchange | POST | /oauth/token | Confirm code redemption and client authentication | | Refresh | POST | /oauth/token | Identify persistence after initial takeover | | Revocation | POST | /oauth/revoke | Invalidate refresh and access tokens |

Parameters

| Parameter | Type | Required | Description | |---|---|---:|---| | response_type | string | Yes | Must be code; reject implicit token delivery | | client_id | string | Yes | Registered OAuth client identifier | | redirect_uri | URI | Yes | Must exactly match the registered URI, including scheme, host, path, and port | | scope | string | Yes | Requested permissions; investigate unexpected privileged scopes | | state | string | Yes | Unpredictable request correlation value; prevents login-CSRF and response mix-up | | code_challenge | string | Yes | PKCE challenge derived from the verifier | | code_challenge_method | string | Yes | Use S256; reject plain | | code | string | Yes at token exchange | Short-lived, single-use authorization code | | code_verifier | string | Yes with PKCE | Secret value proving possession of the original client session |

Code Example

`bash

Authorization request: exact redirect URI and PKCE are mandatory. AUTH_URL="https://idp.example.com/authorize" curl -G "$AUTH_URL" \ --data-urlencode "response_type=code" \ --data-urlencode "client_id=investigation-console" \ --data-urlencode "redirect_uri=https://console.example.com/oauth/callback" \ --data-urlencode "scope=openid profile email" \ --data-urlencode "state=$(openssl rand -hex 32)" \ --data-urlencode "code_challenge=BASE64URL_SHA256_VERIFIER" \ --data-urlencode "code_challenge_method=S256"

Exchange the captured code only at the registered token endpoint. curl -sS -X POST https://idp.example.com/oauth/token \ -H 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=authorization_code' \ --data-urlencode 'client_id=investigation-console' \ --data-urlencode 'redirect_uri=https://console.example.com/oauth/callback' \ --data-urlencode 'code=AUTHORIZATION_CODE' \ --data-urlencode 'code_verifier=ORIGINAL_VERIFIER' `

For an incident, compare authorization and token-exchange timestamps, source IPs, user agents, client IDs, and redirect URIs. A code redeemed from a different network or device within its validity window is a high-value correlation.

Response Format

json { "access_token": "redacted", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "redacted", "scope": "openid profile email" }

access_token authorizes API calls. refresh_token may preserve access after the original code expires. expires_in is the lifetime in seconds. Do not place tokens in URLs, browser history, referrer headers, or incident tickets.

Notes & Best Practices

• Reject redirect URI prefixes, wildcards, user-controlled subdomains, and HTTP except for controlled local development. Exact matching prevents https://console.example.com.attacker.example abuse. - Authorization codes should be single-use and short-lived, commonly 60-120 seconds. Log failed reuse, redirect mismatch, PKCE failure, and client mismatch events. - In the Token Trail Map, connect state, code ID, client ID, redirect URI, token issuance event, and refresh-token activity. Revoke refresh tokens and sessions, then preserve the related logs as audit evidence. - Decision tree: If the redirect URI differs, classify as registration or validation abuse. If it matches but the code was redeemed elsewhere, investigate interception or callback compromise. If PKCE failed open, treat the code as potentially replayable and review all tokens issued from that client.

End of chapter one. 39 more chapters and about 22,472 words in the full book.

1 / 4

Swipe or use the arrows to turn the page

What's inside: 40 chapters

About this book

"Identity Investigation Playbook" is a technical book by David Simpson with 40 chapters and approximately 22,472 words. Practical investigation and response to identity-based cyber attacks.

This book was created using Inkfluence AI, an AI-powered book generation platform that helps authors write, design, and publish complete books. It was made with the AI Documentation Generator.

Frequently Asked Questions

What is "Identity Investigation Playbook" about?

Practical investigation and response to identity-based cyber attacks

How many chapters are in "Identity Investigation Playbook"?

The book contains 40 chapters and approximately 22,472 words. Topics covered include OAuth 2.0 Authorization Code Flow, OIDC ID Token Validation, SAML Assertions and Audience, Kerberos Ticket Lifecycle Checks, and more.

Who wrote "Identity Investigation Playbook"?

This book was written by David Simpson and created using Inkfluence AI, an AI book generation platform that helps authors write, design, and publish books.

How can I create a similar technical book?

You can create your own technical book using Inkfluence AI. Describe your idea, choose your style, and the AI writes the full book for you. It's free to start.

Write your own technical book with AI

Describe your idea and Inkfluence writes the whole thing. Free to start.

Start writing

Created with Inkfluence AI