In ConfigureServices(IServiceCollection services), I added a scoped service which I want to use later to get a value for Add authentication service.
services.AddScoped<IService1, Service1>();
// Add other services
services.AddAuthentication(
// need to use the Service1 to get a value
)