I have Blazor WebAssembly application and I use Auth0 for authentication. Getting it to work was a dream, compared to using Microsofts’ offerings. However, now I am running into a roadblock. I use the <RemoteAuthenticatorView>
component to handle initiating the login request. In .NET 7, you can customize these requests by adding an InteractiveRequestOptions object to the NavigateToLogin()
overload of NavigationManager
:
void BeginLogin(string connectionName)
{
var requestOptions = new InteractiveRequestOptions()
{
Interaction = InteractionType.SignIn,
ReturnUrl = NavigationManager.BaseUri
};
if (!requestOptions.TryAddAdditionalParameter("connection", connectionName))
{
throw new InvalidOperationException("Unable to add parameter");
}
NavigationManager.NavigateToLogin("authentication/login", requestOptions);
}
In this case, I want to add a connection=xxx
url parameter to the /authorize
endpoint to select a specific connection. Unfortunately, the parameter is not added to the url generated by the <RemoteAuthenticatorView>
component. Is there anything I need to configure in the application? Do I need to whitelist these parameters in some way? Any help would be greatly appreciated!