Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions aspnetcore/signalr/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The following table describes options for configuring SignalR hubs:
| ------ | ------------- | ----------- |
| `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.|
| `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). |
| `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. |
| `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. |
| `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. |
| `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. |
| `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.|
Expand Down Expand Up @@ -494,4 +494,4 @@ HubConnection hubConnection = HubConnectionBuilder.create("https://example.com/c

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

[!INCLUDE[](~/signalr/configuration/includes/configuration7.md)]
[!INCLUDE[](~/signalr/configuration/includes/configuration7.md)]
2 changes: 1 addition & 1 deletion aspnetcore/test/integration-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how integration tests ensure that an app's components functio
monikerRange: '>= aspnetcore-3.1'
ms.author: tdykstra
ms.custom: mvc
ms.date: 3/24/2025
ms.date: 03/10/2026
uid: test/integration-tests
zone_pivot_groups: unit-testing-framework
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,21 @@ The test app can mock an <xref:Microsoft.AspNetCore.Authentication.Authenticatio

:::zone-end

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.
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.

:::zone pivot="xunit"

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

:::zone-end
:::zone pivot="mstest"

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

:::zone-end
:::zone pivot="nunit"

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

:::zone-end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ public async Task Get_SecurePageIsReturnedForAnAuthenticatedUser()
{
builder.ConfigureTestServices(services =>
{
services.AddAuthentication(defaultScheme: "TestScheme")
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = "TestScheme";
options.DefaultChallengeScheme = "TestScheme";
})
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
"TestScheme", options => { });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ public async Task Get_SecurePageIsReturnedForAnAuthenticatedUser()
{
builder.ConfigureTestServices(services =>
{
services.AddAuthentication(defaultScheme: "TestScheme")
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = "TestScheme";
options.DefaultChallengeScheme = "TestScheme";
})
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
"TestScheme", options => { });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ public async Task Get_SecurePageIsReturnedForAnAuthenticatedUser()
{
builder.ConfigureTestServices(services =>
{
services.AddAuthentication(defaultScheme: "TestScheme")
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = "TestScheme";
options.DefaultChallengeScheme = "TestScheme";
})
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
"TestScheme", options => { });
});
Expand Down
Loading