24 lines
917 B
C#
24 lines
917 B
C#
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
|
|
|
|
namespace Shogi.UI.Pages.Home.Api
|
|
{
|
|
public class MsalMessageHandler : AuthorizationMessageHandler
|
|
{
|
|
public MsalMessageHandler(IAccessTokenProvider provider, NavigationManager navigation) : base(provider, navigation)
|
|
{
|
|
ConfigureHandler(
|
|
authorizedUrls: new[] { "https://api.lucaserver.space/Shogi.Api", "https://localhost:5001" },
|
|
scopes: new string[] {
|
|
"api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope",
|
|
"offline_access",
|
|
});
|
|
}
|
|
|
|
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
|
{
|
|
return base.SendAsync(request, cancellationToken);
|
|
}
|
|
}
|
|
}
|