Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename AuthenticatonSchemes to AuthenticationSchemes #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Todo.Web/Server/AuthApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions Todo.Web/Server/Authentication/AuthenticationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion Todo.Web/Server/Authentication/ExternalProviders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private async Task<string[]> 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;
}
Expand Down