From 0249c6181c077db4ecbff7cf70f0768f3408168a Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 19 Nov 2015 10:59:02 -0800 Subject: [PATCH] Fix functional unit test after hosting changes --- .../IdentityServiceCollectionExtensions.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Microsoft.AspNet.Identity/IdentityServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Identity/IdentityServiceCollectionExtensions.cs index b576c140c0..5f8b467116 100644 --- a/src/Microsoft.AspNet.Identity/IdentityServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Identity/IdentityServiceCollectionExtensions.cs @@ -2,6 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.Http.Internal; using Microsoft.AspNet.Identity; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -49,6 +51,8 @@ namespace Microsoft.Extensions.DependencyInjection options.SignInScheme = new IdentityCookieOptions().ExternalCookieAuthenticationScheme; }); + // Hosting doesn't add IHttpContextAccessor by default + services.TryAddSingleton(); // Identity services services.TryAddSingleton(); services.TryAddScoped, UserValidator>();