Commit a62a63b
authored
fix(auth): honor ASPNETCORE_FORWARDEDHEADERS_ENABLED for ACA (#1153)
## Why
GitHub OAuth login on dev was generating an `http://` callback URL and
failing with `redirect_uri is not associated with this application`. The
deployment now uses `ASPNETCORE_FORWARDEDHEADERS_ENABLED=true`, so
app-level forwarded-header setup must not conflict with ASP.NET Core's
built-in handling.
## What changed
- `AddTrustedForwardedHeaders` now exits early when
`ASPNETCORE_FORWARDEDHEADERS_ENABLED=true`.
- `Program.cs` skips manual `app.UseForwardedHeaders()` when that env
var is enabled to avoid redundant middleware execution.
- Updated the forwarded-header configuration error message to document
the env-var-based option for platform-managed proxies like Azure
Container Apps.
## Notes for reviewers
This keeps the existing explicit CIDR path intact for environments that
use `ForwardedHeaders:TrustedProxyCidrs`/`TrustedProxies`, while making
ACA's env-var path safe and non-conflicting.1 parent 02cc370 commit a62a63b
2 files changed
Lines changed: 18 additions & 3 deletions
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | | - | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
485 | 490 | | |
486 | 491 | | |
487 | 492 | | |
| |||
532 | 537 | | |
533 | 538 | | |
534 | 539 | | |
535 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
536 | 544 | | |
537 | 545 | | |
538 | 546 | | |
| |||
0 commit comments