We have a Blazor Server application that we want to serve as a directory, allowing users to sign into other disparate services. Each of them is an existing service with its own ClientId, and many users connect to them directly. We just want to provide a centralized, web based tool to make it more convenient for the user to find and log into these services.
Essentially, we want to show each service in a list, and, when a user clicks on one, the Web App will fetch the appropriate ClientId for that service. It will then try to authenticate the current user against that Id using Auth0, receiving the token as a string on success. Then, we would launch the selected service and pass along the token to authenticate the user to that service using the service's existing Auth0 implementation.
Every step of that process is currently functional, except for acquiring the token. We need to be able to provide a ClientId at runtime, authenticate the user against it, and then get a token back that we can pass on to the service.
Everything I've found so far just says to use middleware (authenticationBuilder.AddAuth0WebAppAuthentication), but that requires the Domain and ClientId to be specified at startup, so it doesn't work for this use case.
Is there any way to accomplish this with Blazor Server?