diff --git a/test/Microsoft.AspNetCore.Authentication.Test/Facebook/FacebookMiddlewareTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/Facebook/FacebookMiddlewareTests.cs index f38ca8afc8..4d6cabaf1b 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/Facebook/FacebookMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/Facebook/FacebookMiddlewareTests.cs @@ -17,6 +17,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using Newtonsoft.Json; using Xunit; @@ -163,7 +164,7 @@ namespace Microsoft.AspNetCore.Authentication.Facebook { var customUserInfoEndpoint = "https://graph.facebook.com/me?fields=email,timezone,picture"; var finalUserInfoEndpoint = string.Empty; - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("FacebookTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("FacebookTest")); var server = CreateServer( app => { diff --git a/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs index 2a47f1e89c..090f9f1210 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs @@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using Newtonsoft.Json; using Xunit; @@ -293,7 +294,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [InlineData("CustomIssuer")] public async Task ReplyPathWillAuthenticateValidAuthorizeCodeAndState(string claimsIssuer) { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -383,7 +384,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [InlineData(false)] public async Task ReplyPathWillThrowIfCodeIsInvalid(bool redirect) { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -436,7 +437,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [InlineData(false)] public async Task ReplyPathWillRejectIfAccessTokenIsMissing(bool redirect) { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -485,7 +486,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task AuthenticatedEventCanGetRefreshToken() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -565,7 +566,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task NullRedirectUriWillRedirectToSlash() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -638,7 +639,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task ValidateAuthenticatedContext() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -736,7 +737,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task CanRedirectOnError() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -764,7 +765,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task AuthenticateAutomaticWhenAlreadySignedInSucceeds() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -807,7 +808,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task AuthenticateGoogleWhenAlreadySignedInSucceeds() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -850,7 +851,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task ChallengeGoogleWhenAlreadySignedInReturnsForbidden() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -886,7 +887,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task AuthenticateFacebookWhenAlreadySignedWithGoogleReturnsNull() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", @@ -922,7 +923,7 @@ namespace Microsoft.AspNetCore.Authentication.Google [Fact] public async Task ChallengeFacebookWhenAlreadySignedWithGoogleSucceeds() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("GoogleTest")); var server = CreateServer(new GoogleOptions { ClientId = "Test Id", diff --git a/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs index 0ddfb5a3c7..0ed164e496 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs @@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using Newtonsoft.Json; using Xunit; @@ -103,7 +104,7 @@ namespace Microsoft.AspNetCore.Authentication.Tests.MicrosoftAccount [Fact] public async Task AuthenticatedEventCanGetRefreshToken() { - var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("MsftTest")); + var stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider(NullLoggerFactory.Instance).CreateProtector("MsftTest")); var server = CreateServer(new MicrosoftAccountOptions { ClientId = "Test Client Id",