From 375b0bc0a4b9df357a00306667e9604a4103832f Mon Sep 17 00:00:00 2001 From: Philipp Wagner Date: Fri, 19 Jan 2024 14:40:47 +0100 Subject: [PATCH] Rename AuthenticatonSchemes to AuthenticationSchemes --- Todo.Web/Server/AuthApi.cs | 4 ++-- Todo.Web/Server/Authentication/AuthenticationExtensions.cs | 6 +++--- .../{AuthenticatonSchemes.cs => AuthenticationSchemes.cs} | 2 +- Todo.Web/Server/Authentication/ExternalProviders.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename Todo.Web/Server/Authentication/{AuthenticatonSchemes.cs => AuthenticationSchemes.cs} (83%) diff --git a/Todo.Web/Server/AuthApi.cs b/Todo.Web/Server/AuthApi.cs index fd6db2f5..cd170ab5 100644 --- a/Todo.Web/Server/AuthApi.cs +++ b/Todo.Web/Server/AuthApi.cs @@ -63,7 +63,7 @@ public static RouteGroupBuilder MapAuth(this IEndpointRouteBuilder routes) group.MapGet("signin/{provider}", async (string provider, AuthClient client, HttpContext context) => { // Grab the login information from the external login dance - var result = await context.AuthenticateAsync(AuthenticatonSchemes.ExternalScheme); + var result = await context.AuthenticateAsync(AuthenticationSchemes.ExternalScheme); if (result.Succeeded) { @@ -85,7 +85,7 @@ public static RouteGroupBuilder MapAuth(this IEndpointRouteBuilder routes) } // Delete the external cookie - await context.SignOutAsync(AuthenticatonSchemes.ExternalScheme); + await context.SignOutAsync(AuthenticationSchemes.ExternalScheme); // TODO: Handle the failure somehow diff --git a/Todo.Web/Server/Authentication/AuthenticationExtensions.cs b/Todo.Web/Server/Authentication/AuthenticationExtensions.cs index a7ec9837..fac86152 100644 --- a/Todo.Web/Server/Authentication/AuthenticationExtensions.cs +++ b/Todo.Web/Server/Authentication/AuthenticationExtensions.cs @@ -19,7 +19,7 @@ public static WebApplicationBuilder AddAuthentication(this WebApplicationBuilder authenticationBuilder.AddCookie(); // This is the cookie that will store the user information from the external login provider - authenticationBuilder.AddCookie(AuthenticatonSchemes.ExternalScheme); + authenticationBuilder.AddCookie(AuthenticationSchemes.ExternalScheme); // Add external auth providers based on configuration //{ @@ -59,7 +59,7 @@ public static WebApplicationBuilder AddAuthentication(this WebApplicationBuilder // This will save the information in the external cookie if (options is RemoteAuthenticationOptions remoteAuthenticationOptions) { - remoteAuthenticationOptions.SignInScheme = AuthenticatonSchemes.ExternalScheme; + remoteAuthenticationOptions.SignInScheme = AuthenticationSchemes.ExternalScheme; } else if (options is Auth0WebAppOptions auth0WebAppOptions) { @@ -88,7 +88,7 @@ static void SetAuth0SignInScheme(WebApplicationBuilder builder) { // The Auth0 APIs don't let you set the sign in scheme, it defaults to the default sign in scheme. // Use named options to configure the underlying OpenIdConnectOptions's sign in scheme instead. - o.SignInScheme = AuthenticatonSchemes.ExternalScheme; + o.SignInScheme = AuthenticationSchemes.ExternalScheme; }); } } diff --git a/Todo.Web/Server/Authentication/AuthenticatonSchemes.cs b/Todo.Web/Server/Authentication/AuthenticationSchemes.cs similarity index 83% rename from Todo.Web/Server/Authentication/AuthenticatonSchemes.cs rename to Todo.Web/Server/Authentication/AuthenticationSchemes.cs index 02bfd628..1eb9aba4 100644 --- a/Todo.Web/Server/Authentication/AuthenticatonSchemes.cs +++ b/Todo.Web/Server/Authentication/AuthenticationSchemes.cs @@ -1,6 +1,6 @@ namespace Todo.Web.Server; -public class AuthenticatonSchemes +public class AuthenticationSchemes { // This is the scheme used to store login information from external providers public static string ExternalScheme => "External"; diff --git a/Todo.Web/Server/Authentication/ExternalProviders.cs b/Todo.Web/Server/Authentication/ExternalProviders.cs index 99d31f02..6cdc8f1e 100644 --- a/Todo.Web/Server/Authentication/ExternalProviders.cs +++ b/Todo.Web/Server/Authentication/ExternalProviders.cs @@ -28,7 +28,7 @@ private async Task GetProviderNamesAsyncCore() { // We're assuming all schemes that aren't cookies are social if (s.Name == CookieAuthenticationDefaults.AuthenticationScheme || - s.Name == AuthenticatonSchemes.ExternalScheme) + s.Name == AuthenticationSchemes.ExternalScheme) { continue; }