Skip to content

Commit 477f975

Browse files
authored
Enhance instructions to Test CORS (#35593)
1 parent 6d27bb8 commit 477f975

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aspnetcore/security/cors.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ The [sample download](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnet
546546
> [!WARNING]
547547
> `WithOrigins("https://localhost:<port>");` should only be used for testing a sample app similar to the [download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/live/aspnetcore/security/cors/8.0sample/Cors).
548548
549+
> [!NOTE]
550+
> If you're using `launchSettings.json` in Visual Studio or [configuring C# debug settings in VS Code](https://code.visualstudio.com/docs/csharp/debugger-settings), and using IIS Express to debug locally, ensure that you've configured IIS Express for `"anonymousAuthentication": true`. When `"anonymousAuthentication"` is `false`, the ASP.NET Core web environment host will not see any preflight requests. In particular, if you're using NTLM authentication (`"windowsAuthentication": true`), the first step of the NTLM challenge-response is to send the web browser a 401 challenge, which can make it challenging to verify your preflight route is configured correctly.
551+
549552
The following `ValuesController` provides the endpoints for testing:
550553

551554
[!code-csharp[](~/security/cors/8.0sample/Cors/Web2API/Controllers/ValuesController.cs?name=snippet)]

0 commit comments

Comments
 (0)