Skip to content

Commit

Permalink
rename AzureAD to EntraID
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Oct 10, 2023
1 parent fe2fbd3 commit f699140
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Moonglade.Auth/AuthenticationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

public enum AuthenticationProvider
{
AzureAD,
EntraID,
Local
}
2 changes: 1 addition & 1 deletion src/Moonglade.Auth/BlogAuthSchemas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace Moonglade.Auth;

public static class BlogAuthSchemas
{
public const string AzureAD = CookieAuthenticationDefaults.AuthenticationScheme;
public const string EntraID = CookieAuthenticationDefaults.AuthenticationScheme;
public const string Local = CookieAuthenticationDefaults.AuthenticationScheme;
}
4 changes: 2 additions & 2 deletions src/Moonglade.Auth/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public static IServiceCollection AddBlogAuthenticaton(this IServiceCollection se

switch (authentication.Provider)
{
case AuthenticationProvider.AzureAD:
case AuthenticationProvider.EntraID:
services.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
}).AddMicrosoftIdentityWebApp(configuration.GetSection("Authentication:AzureAd"));
}).AddMicrosoftIdentityWebApp(configuration.GetSection("Authentication:EntraID"));
// Internally pass `null` to cookie options so there's no way to add `AccessDeniedPath` here.

break;
Expand Down
2 changes: 1 addition & 1 deletion src/Moonglade.Web/Controllers/AuthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task<IActionResult> SignOut(int nounce = 1055)
{
switch (_authenticationSettings.Provider)
{
case AuthenticationProvider.AzureAD:
case AuthenticationProvider.EntraID:
var callbackUrl = Url.Page("/Index", null, null, Request.Scheme);
return SignOut(
new AuthenticationProperties { RedirectUri = callbackUrl },
Expand Down
2 changes: 1 addition & 1 deletion src/Moonglade.Web/Pages/SignIn.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task<IActionResult> OnGetAsync()
{
switch (_authenticationSettings.Provider)
{
case AuthenticationProvider.AzureAD:
case AuthenticationProvider.EntraID:
return Challenge(
new AuthenticationProperties { RedirectUri = "/" },
OpenIdConnectDefaults.AuthenticationScheme);
Expand Down
2 changes: 1 addition & 1 deletion src/Moonglade.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"Authentication": {
"Provider": "Local",
"AzureAd": {
"EntraID": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "",
"TenantId": "",
Expand Down

0 comments on commit f699140

Please sign in to comment.