Is there a way to supply a domain hint for single sign-on using MSAL.NET on a Blazor WebAssembly Client?

Viewed 481

Is there any way to supply a domain hint (or otherwise avoid the need for the "pick an account" prompt) when using MSAL.NET in a Blazor WebAssembly application on the client side? I thought maybe it would be a setting or option passed in to builder.Services.AddMsalAuthentication, but I don't see it.

I figured it out for the server, but not the client yet. Without being able to set this, I get redundant "pick an account" prompts from microsoftonline.com when trying to authenticate.

I currently have, in Program.cs on the client:

builder.Services.AddMsalAuthentication(options =>
{
    builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
    options.ProviderOptions.DefaultAccessTokenScopes.Add(myScope);
    options.UserOptions.RoleClaim = "roles";
});
1 Answers

Sending the domain_hint with Blazor web assembly is not supported currently. I have opened a GitHub issue to track this further.

Related