diff --git a/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs index c2d843bf10..83083cbf0a 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs @@ -1247,7 +1247,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies => CreateServerWithServices(s => { s.AddSingleton(_clock); - s.AddAuthentication().AddCookie(configureOptions); + s.AddAuthentication(o => o.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(configureOptions); s.AddSingleton(); }, testpath, baseAddress); diff --git a/test/Microsoft.AspNetCore.Authentication.Test/DynamicSchemeTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/DynamicSchemeTests.cs index fe7443679c..d658609b04 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/DynamicSchemeTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/DynamicSchemeTests.cs @@ -86,24 +86,6 @@ namespace Microsoft.AspNetCore.Authentication await Assert.ThrowsAsync(() => server.SendAsync("http://example.com/auth/One")); } - [Fact] - public async Task VerifyDefaultBehavior() - { - var server = CreateServer(); - - await Assert.ThrowsAsync(() => server.SendAsync("http://example.com/auth")); - - var response = await server.CreateClient().GetAsync("http://example.com/add/One"); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - var transaction = await server.SendAsync("http://example.com/auth"); - Assert.Equal("One", transaction.FindClaimValue(ClaimTypes.NameIdentifier, "One")); - response = await server.CreateClient().GetAsync("http://example.com/add/Two"); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - - // Default will blow up since now there's two - await Assert.ThrowsAsync(() => server.SendAsync("http://example.com/auth")); - } - public class TestOptions : AuthenticationSchemeOptions { public Singleton Instance { get; set; } diff --git a/test/Microsoft.AspNetCore.Authentication.Test/FacebookTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/FacebookTests.cs index 43c52b0fd9..35752ec6b0 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/FacebookTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/FacebookTests.cs @@ -81,8 +81,7 @@ namespace Microsoft.AspNetCore.Authentication.Facebook { services.AddAuthentication(options => { - options.DefaultSignInScheme = "External"; - options.DefaultAuthenticateScheme = "External"; + options.DefaultScheme = "External"; }) .AddCookie("External", o => { }) .AddFacebook(o => @@ -221,7 +220,7 @@ namespace Microsoft.AspNetCore.Authentication.Facebook { services.AddAuthentication(options => { - options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; + options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; }) .AddCookie() .AddFacebook(o => diff --git a/test/Microsoft.AspNetCore.Authentication.Test/GoogleTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/GoogleTests.cs index 3bfea45df8..f1038bb51d 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/GoogleTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/GoogleTests.cs @@ -1050,7 +1050,7 @@ namespace Microsoft.AspNetCore.Authentication.Google services.AddTransient(); services.AddAuthentication(o => { - o.DefaultAuthenticateScheme = TestExtensions.CookieAuthenticationScheme; + o.DefaultScheme = TestExtensions.CookieAuthenticationScheme; o.DefaultChallengeScheme = GoogleDefaults.AuthenticationScheme; }); services.AddAuthentication() diff --git a/test/Microsoft.AspNetCore.Authentication.Test/JwtBearerTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/JwtBearerTests.cs index c7153ded30..e001bd9950 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/JwtBearerTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/JwtBearerTests.cs @@ -748,7 +748,7 @@ namespace Microsoft.AspNetCore.Authentication.JwtBearer } }); }) - .ConfigureServices(services => services.AddAuthentication().AddJwtBearer(options)); + .ConfigureServices(services => services.AddAuthentication(o => o.DefaultScheme = JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options)); return new TestServer(builder); } diff --git a/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccountTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccountTests.cs index 941dd13481..b63ad1f7d6 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccountTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/MicrosoftAccountTests.cs @@ -226,7 +226,7 @@ namespace Microsoft.AspNetCore.Authentication.Tests.MicrosoftAccount { services.AddAuthentication(o => { - o.DefaultAuthenticateScheme = TestExtensions.CookieAuthenticationScheme; + o.DefaultScheme = TestExtensions.CookieAuthenticationScheme; }); services.AddAuthentication() .AddCookie(TestExtensions.CookieAuthenticationScheme, o => { }) diff --git a/test/Microsoft.AspNetCore.Authentication.Test/OpenIdConnect/TestServerBuilder.cs b/test/Microsoft.AspNetCore.Authentication.Test/OpenIdConnect/TestServerBuilder.cs index 1ffb9ff686..4d6a268217 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/OpenIdConnect/TestServerBuilder.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/OpenIdConnect/TestServerBuilder.cs @@ -111,7 +111,7 @@ namespace Microsoft.AspNetCore.Authentication.Test.OpenIdConnect { services.AddAuthentication(o => { - o.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; + o.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; }); services.AddAuthentication() .AddCookie()