public WaitForIdentityServerMiddleware(RequestDelegate next, IConfiguration configuration, WaitForIdentityServerOptions options)
        {
            _next         = next;
            _startTime    = DateTime.UtcNow;
            _discoveryUrl = buildDiscoveryUrl(options.Authority);

            _refreshLock = new SemaphoreSlim(1);
        }
 public static IApplicationBuilder UseWaitForIdentityServer(this IApplicationBuilder builder, WaitForIdentityServerOptions options)
 {
     return(builder.UseMiddleware <WaitForIdentityServerMiddleware>(options));
 }