Fix functional unit test after hosting changes

This commit is contained in:
Pavel Krymets 2015-11-19 10:59:02 -08:00
parent 062eeeeb94
commit 0249c6181c
1 changed files with 4 additions and 0 deletions

View File

@ -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<IHttpContextAccessor, HttpContextAccessor>();
// Identity services
services.TryAddSingleton<IdentityMarkerService>();
services.TryAddScoped<IUserValidator<TUser>, UserValidator<TUser>>();