Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ This prevents redirect_uri manipulation attacks within the same origin.

### Without Redirect Headers (current OAuth)

**Client Website returns to Browser:**
**Server-side Client Website returns URL to Browser:**
```http
HTTP/1.1 302 Found
Location: https://as.example/authorize?client_id=abc&state=123&redirect_uri=...
```

**Browser navigates, sends to AS:**
**Browser navigates to the URL, which is the AS:**
```http
GET /authorize?client_id=abc&state=123&redirect_uri=...
Host: as.example
Expand All @@ -164,7 +164,7 @@ HTTP/1.1 302 Found
Location: https://app.example/cb?code=SplxlOBe&state=123 ← Leaked in URL
```

**Browser sends code to Client Website:**
**Browser sends code to Server-Side Client Website to complete the code exchange:**
```http
GET /cb?code=SplxlOBe&state=123 ← In browser history, logs, analytics
Host: app.example
Expand All @@ -179,15 +179,15 @@ Referer: https://as.example/consent ← Third-party resources see code via Refe

### With Redirect Headers

**Client Website returns to Browser:**
**Server-side Client Website returns URL to Browser:**
```http
HTTP/1.1 302 Found
Location: https://as.example/authorize?client_id=abc&state=123
Redirect-Query: "client_id=abc&state=123"
Redirect-Path: "/app1/"
```

**Browser navigates, adds origin and forwards to AS:**
**Browser navigates to the URL, which is the AS:**
```http
GET /authorize?client_id=abc&state=123
Host: as.example
Expand All @@ -196,14 +196,14 @@ Redirect-Path: "/app1/"
Redirect-Query: "client_id=abc&state=123"
```

**AS validates and returns to Browser:**
**AS returns code to Browser:**
```http
HTTP/1.1 302 Found
Location: https://app.example/cb ← No parameters in URL!
Redirect-Query: "code=SplxlOBe&state=123"
```

**Browser forwards back to Client Website:**
**Browser sends code to Server-Side Client Website to complete the code exchange:**
```http
GET /cb ← Clean URL
Host: app.example
Expand Down