Try to redirect on MSAL logout.

This commit is contained in:
2023-07-06 21:01:58 -05:00
parent d80ea13b68
commit a246de8928
4 changed files with 8 additions and 9 deletions

View File

@@ -95,7 +95,10 @@ namespace Shogi.Api
{ {
await socketService.HandleSocketRequest(context); await socketService.HandleSocketRequest(context);
} }
await next(); else
{
await next();
}
}); });
} }

View File

@@ -2,7 +2,7 @@
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication @using Microsoft.AspNetCore.Components.WebAssembly.Authentication
<RemoteAuthenticatorView Action="@Action" /> <RemoteAuthenticatorView Action="@Action" />
@code{ @code {
[Parameter] public string? Action { get; set; } [Parameter] public string? Action { get; set; }
// https://github.com/dotnet/aspnetcore/blob/main/src/Components/WebAssembly/WebAssembly.Authentication/src/Models/RemoteAuthenticationActions.cs // https://github.com/dotnet/aspnetcore/blob/main/src/Components/WebAssembly/WebAssembly.Authentication/src/Models/RemoteAuthenticationActions.cs
// https://github.com/dotnet/aspnetcore/blob/7c810658463f35c39c54d5fb8a8dbbfd463bf747/src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs // https://github.com/dotnet/aspnetcore/blob/7c810658463f35c39c54d5fb8a8dbbfd463bf747/src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs

View File

@@ -123,7 +123,7 @@ public class AccountManager
else if (platform == WhichAccountPlatform.Microsoft) else if (platform == WhichAccountPlatform.Microsoft)
{ {
await accountState.SetUser(null); await accountState.SetUser(null);
navigation.NavigateToLogout("authentication/logout"); navigation.NavigateToLogout("authentication/logout", "https://lucaserver.space/shogi");
} }
} }
} }

View File

@@ -39,11 +39,7 @@ static void ConfigureDependencies(IServiceCollection services, IConfiguration co
services.AddMsalAuthentication(options => services.AddMsalAuthentication(options =>
{ {
configuration.Bind("AzureAd", options.ProviderOptions.Authentication); configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
//options.ProviderOptions.DefaultAccessTokenScopes.Add("https://graph.microsoft.com/User.Read"); options.ProviderOptions.LoginMode = "redirect";
//options.ProviderOptions.DefaultAccessTokenScopes.Add("openid");
//options.ProviderOptions.DefaultAccessTokenScopes.Add("offline_access");
//options.ProviderOptions.DefaultAccessTokenScopes.Add("profile");
//options.ProviderOptions.LoginMode = "redirect";
}); });
services.AddOidcAuthentication(options => services.AddOidcAuthentication(options =>