问题描述
在客户端上的Blazor WebAssembly应用程序中使用 MSAL.NET 时,是否可以通过任何方式提供域提示(或避免使用“选择帐户”提示) 我以为可能是传递给builder.Services.AddMsalAuthentication的设置或选项,但我没有看到它。
I figured it out for the server,但尚未客户端。无法设置此项,尝试进行身份验证时,我从microsoftonline.com收到多余的“选择帐户”提示。
我目前在客户端的Program.cs中拥有
builder.Services.AddMsalAuthentication(options =>
{
builder.Configuration.Bind("AzureAd",options.ProviderOptions.Authentication);
options.ProviderOptions.DefaultAccessTokenScopes.Add(myScope);
options.UserOptions.RoleClaim = "roles";
});
解决方法
当前不支持通过Blazor Web程序集发送domain_hint。我打开了GitHub issue来进行进一步的跟踪。