Skip to content

Commit 220b91b

Browse files
authored
Merge pull request #36865 from dotnet/main
Merge to Live
2 parents dbba834 + fa4a2fa commit 220b91b

6 files changed

Lines changed: 22 additions & 10 deletions

File tree

aspnetcore/signalr/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The following table describes options for configuring SignalR hubs:
6868
| ------ | ------------- | ----------- |
6969
| `ClientTimeoutInterval` | 30 seconds | The server considers the client disconnected if it hasn't received a message (including keep-alive) in this interval. It could take longer than this timeout interval for the client to be marked disconnected due to how this is implemented. The recommended value is double the `KeepAliveInterval` value.|
7070
| `HandshakeTimeout` | 15 seconds | If the client doesn't send an initial handshake message within this time interval, the connection is closed. This is an advanced setting that should only be modified if handshake timeout errors are occurring due to severe network latency. For more detail on the handshake process, see the [SignalR Hub Protocol Specification](https://github.com/aspnet/SignalR/blob/master/specs/HubProtocol.md). |
71-
| `KeepAliveInterval` | 15 seconds | If the server hasn't sent a message within this interval, a ping message is sent automatically to keep the connection open. When changing `KeepAliveInterval`, change the `ServerTimeout` or `serverTimeoutInMilliseconds` setting on the client. The recommended `ServerTimeout` or `serverTimeoutInMilliseconds` value is double the `KeepAliveInterval` value. |
71+
| `KeepAliveInterval` | 15 seconds | The interval at which a ping message is sent automatically to keep the connection open. When changing `KeepAliveInterval`, change the `ServerTimeout` or `serverTimeoutInMilliseconds` setting on the client. The recommended `ServerTimeout` or `serverTimeoutInMilliseconds` value is double the `KeepAliveInterval` value. |
7272
| `SupportedProtocols` | All installed protocols | Protocols supported by this hub. By default, all protocols registered on the server are allowed. Protocols can be removed from this list to disable specific protocols for individual hubs. |
7373
| `EnableDetailedErrors` | `false` | If `true`, detailed exception messages are returned to clients when an exception is thrown in a Hub method. The default is `false` because these exception messages can contain sensitive information. |
7474
| `StreamBufferCapacity` | `10` | The maximum number of items that can be buffered for client upload streams. If this limit is reached, the processing of invocations is blocked until the server processes stream items.|
@@ -494,4 +494,4 @@ HubConnection hubConnection = HubConnectionBuilder.create("https://example.com/c
494494

495495
[!INCLUDE[](~/signalr/configuration/includes/configuration6.md)]
496496

497-
[!INCLUDE[](~/signalr/configuration/includes/configuration7.md)]
497+
[!INCLUDE[](~/signalr/configuration/includes/configuration7.md)]

aspnetcore/test/integration-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how integration tests ensure that an app's components functio
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: tdykstra
77
ms.custom: mvc
8-
ms.date: 3/24/2025
8+
ms.date: 03/10/2026
99
uid: test/integration-tests
1010
zone_pivot_groups: unit-testing-framework
1111
---

aspnetcore/test/integration-tests/includes/integration-tests9.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,21 +369,21 @@ The test app can mock an <xref:Microsoft.AspNetCore.Authentication.Authenticatio
369369

370370
:::zone-end
371371

372-
The `TestAuthHandler` is called to authenticate a user when the authentication scheme is set to `TestScheme` where `AddAuthentication` is registered for `ConfigureTestServices`. It's important for the `TestScheme` scheme to match the scheme your app expects. Otherwise, authentication won't work.
372+
The `TestAuthHandler` is called to authenticate a user when the authentication scheme is set to `TestScheme` where `AddAuthentication` is registered for `ConfigureTestServices`. `DefaultAuthenticateScheme` and `DefaultChallengeScheme` are explicitly set to `TestScheme` to ensure the test handler overrides any authentication configuration set by the app. It's important for the `TestScheme` scheme to match the scheme your app expects. Otherwise, authentication won't work.
373373

374374
:::zone pivot="xunit"
375375

376-
:::code language="csharp" source="~/test/integration-tests/snippets/xunit/IntegrationTests/AuthTests.cs" id="snippet3" highlight="7-12":::
376+
:::code language="csharp" source="~/test/integration-tests/snippets/xunit/IntegrationTests/AuthTests.cs" id="snippet3" highlight="7-16":::
377377

378378
:::zone-end
379379
:::zone pivot="mstest"
380380

381-
:::code language="csharp" source="~/test/integration-tests/snippets/mstest/IntegrationTests/AuthTests.cs" id="snippet3" highlight="7-12":::
381+
:::code language="csharp" source="~/test/integration-tests/snippets/mstest/IntegrationTests/AuthTests.cs" id="snippet3" highlight="7-16":::
382382

383383
:::zone-end
384384
:::zone pivot="nunit"
385385

386-
:::code language="csharp" source="~/test/integration-tests/snippets/nunit/IntegrationTests/AuthTests.cs" id="snippet3" highlight="7-12":::
386+
:::code language="csharp" source="~/test/integration-tests/snippets/nunit/IntegrationTests/AuthTests.cs" id="snippet3" highlight="7-16":::
387387

388388
:::zone-end
389389

aspnetcore/test/integration-tests/snippets/mstest/IntegrationTests/AuthTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ public async Task Get_SecurePageIsReturnedForAnAuthenticatedUser()
112112
{
113113
builder.ConfigureTestServices(services =>
114114
{
115-
services.AddAuthentication(defaultScheme: "TestScheme")
115+
services.AddAuthentication(options =>
116+
{
117+
options.DefaultAuthenticateScheme = "TestScheme";
118+
options.DefaultChallengeScheme = "TestScheme";
119+
})
116120
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
117121
"TestScheme", options => { });
118122
});

aspnetcore/test/integration-tests/snippets/nunit/IntegrationTests/AuthTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ public async Task Get_SecurePageIsReturnedForAnAuthenticatedUser()
110110
{
111111
builder.ConfigureTestServices(services =>
112112
{
113-
services.AddAuthentication(defaultScheme: "TestScheme")
113+
services.AddAuthentication(options =>
114+
{
115+
options.DefaultAuthenticateScheme = "TestScheme";
116+
options.DefaultChallengeScheme = "TestScheme";
117+
})
114118
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
115119
"TestScheme", options => { });
116120
});

aspnetcore/test/integration-tests/snippets/xunit/IntegrationTests/AuthTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ public async Task Get_SecurePageIsReturnedForAnAuthenticatedUser()
106106
{
107107
builder.ConfigureTestServices(services =>
108108
{
109-
services.AddAuthentication(defaultScheme: "TestScheme")
109+
services.AddAuthentication(options =>
110+
{
111+
options.DefaultAuthenticateScheme = "TestScheme";
112+
options.DefaultChallengeScheme = "TestScheme";
113+
})
110114
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
111115
"TestScheme", options => { });
112116
});

0 commit comments

Comments
 (0)