Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit e6791cc

Browse files
committed
Ensure an ObjectPoolProvider is registered
- take advantage of aspnet/HttpAbstractions#561 fix
1 parent 22d133c commit e6791cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Microsoft.AspNetCore.Authentication/AuthenticationServiceCollectionExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
using System;
55
using Microsoft.AspNetCore.Authentication;
6+
using Microsoft.Extensions.DependencyInjection.Extensions;
7+
using Microsoft.Extensions.ObjectPool;
68

79
namespace Microsoft.Extensions.DependencyInjection
810
{
@@ -12,7 +14,7 @@ namespace Microsoft.Extensions.DependencyInjection
1214
public static class AuthenticationServiceCollectionExtensions
1315
{
1416
/// <summary>
15-
/// Adds authentication services to the specified <see cref="IServiceCollection" />.
17+
/// Adds authentication services to the specified <see cref="IServiceCollection" />.
1618
/// </summary>
1719
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
1820
/// <returns>A reference to this instance after the operation has completed.</returns>
@@ -25,11 +27,13 @@ public static IServiceCollection AddAuthentication(this IServiceCollection servi
2527

2628
services.AddWebEncoders();
2729
services.AddDataProtection();
30+
services.TryAddSingleton<ObjectPoolProvider, DefaultObjectPoolProvider>();
31+
2832
return services;
2933
}
3034

3135
/// <summary>
32-
/// Adds authentication services to the specified <see cref="IServiceCollection" />.
36+
/// Adds authentication services to the specified <see cref="IServiceCollection" />.
3337
/// </summary>
3438
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
3539
/// <param name="configureOptions">An action delegate to configure the provided <see cref="SharedAuthenticationOptions"/>.</param>

0 commit comments

Comments
 (0)