Closed
Description
Description
I am using the MSAL authentication with Azure AD trying to add prompt parameter to the sign in. It does not work as expected.
The observed request https://login.microsoftonline.com/common/oauth2/v2.0/authorize?...
doesn't contain the prompt parameter and the request just completes with SSO.
Reproduction Steps
RedirectToLoginSelectAccount.razor
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
@inject NavigationManager Navigation
@code {
protected override void OnInitialized()
{
var requestOptions = new InteractiveRequestOptions()
{
Interaction = InteractionType.SignIn,
ReturnUrl = Navigation.Uri,
};
requestOptions.TryAddAdditionalParameter("prompt", "select_account");
Navigation.NavigateToLogin("authentication/login", requestOptions);
}
}
The following weird version works on development build in VS, but doesn't work in published release build.
var extraQueryParametersDictionary = new Dictionary<string, string> { ["prompt"] = "select_account" };
requestOptions.TryAddAdditionalParameter("extraQueryParameters",
JsonSerializer.Deserialize<JsonElement>(JsonSerializer.Serialize(extraQueryParametersDictionary)));
Expected behavior
Authentication to include the prompt parameter.
Actual behavior
Prompt parameter missing.
Regression?
No response
Known Workarounds
No response
Configuration
7.0.101 [C:\Program Files\dotnet\sdk]
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-rtm.22512.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-rtm.22512.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="7.0.0-rtm.22512.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0-rtm.22511.4" />
Other information
No response