コード例 #1
0
        private string GetJwksHttp()
        {
            var jwksUri = _env.JwksUri;

            try
            {
                _logger.LogTrace("Sending jwks request", new { jwksUri });

                var jwks = _jwkClient.GetJwks(jwksUri);

                _logger.LogTrace("Received jwks response", new { jwks });

                Environment.SetEnvironmentVariable("JWKS", jwks);

                return(jwks.DefaultTo(null));
            }
            catch (Exception ex)
            {
                _logger.LogError("Could not successfully communicate with the auth service's jwks endpoint", new { jwksUri });
                throw new JsonWebKeyClientException(ex);
            }
        }