Source:
<code>IdentityClient(String tenantId, String clientId, IdentityClientOptions options) { if (tenantId == null) { tenantId = "common"; } if (options == null) { options = new IdentityClientOptions(); } this.tenantId = tenantId; this.clientId = clientId; this.options = options; if (clientId == null) { this.publicClientApplication = null; } else { String authorityUrl = options.getAuthorityHost().replaceAll("/+$", "") + "/organizations/" + tenantId; PublicClientApplication.Builder publicClientApplicationBuilder = PublicClientApplication.builder(clientId); try { publicClientApplicationBuilder = publicClientApplicationBuilder.authority(authorityUrl); } catch (MalformedURLException e) { throw logger.logExceptionAsWarning(new IllegalStateException(e)); } HttpPipeline httpPipeline = options.getHttpPipeline(); if (httpPipeline != null) { httpPipelineAdapter = new HttpPipelineAdapter(httpPipeline); publicClientApplicationBuilder.httpClient(httpPipelineAdapter); } else { HttpClient httpClient = options.getHttpClient(); if (httpClient != null) { httpPipelineAdapter = new HttpPipelineAdapter(setupPipeline(httpClient)); publicClientApplicationBuilder.httpClient(httpPipelineAdapter); } else if (options.getProxyOptions() != null) { publicClientApplicationBuilder.proxy(proxyOptionsToJavaNetProxy(options.getProxyOptions())); } else { <START> httpPipelineAdapter = new HttpPipelineAdapter(setupPipeline(httpClient)); <END> publicClientApplicationBuilder.httpClient(httpPipelineAdapter); } } this.publicClientApplication = publicClientApplicationBuilder.build(); } }</code><technical_language>Instead of passing httpClient here, HttpClient.createDefault() httpClient is null</technical_language>

Target:
IdentityClient(String tenantId, String clientId, IdentityClientOptions options) { if (tenantId == null) { tenantId = "common"; } if (options == null) { options = new IdentityClientOptions(); } this.tenantId = tenantId; this.clientId = clientId; this.options = options; if (clientId == null) { this.publicClientApplication = null; } else { String authorityUrl = options.getAuthorityHost().replaceAll("/+$", "") + "/organizations/" + tenantId; PublicClientApplication.Builder publicClientApplicationBuilder = PublicClientApplication.builder(clientId); try { publicClientApplicationBuilder = publicClientApplicationBuilder.authority(authorityUrl); } catch (MalformedURLException e) { throw logger.logExceptionAsWarning(new IllegalStateException(e)); } HttpPipeline httpPipeline = options.getHttpPipeline(); if (httpPipeline != null) { httpPipelineAdapter = new HttpPipelineAdapter(httpPipeline); publicClientApplicationBuilder.httpClient(httpPipelineAdapter); } else { HttpClient httpClient = options.getHttpClient(); if (httpClient != null) { httpPipelineAdapter = new HttpPipelineAdapter(setupPipeline(httpClient)); publicClientApplicationBuilder.httpClient(httpPipelineAdapter); } else if (options.getProxyOptions() != null) { publicClientApplicationBuilder.proxy(proxyOptionsToJavaNetProxy(options.getProxyOptions())); } else { httpPipelineAdapter = new HttpPipelineAdapter(setupPipeline(HttpClient.createDefault())); publicClientApplicationBuilder.httpClient(httpPipelineAdapter); } } this.publicClientApplication = publicClientApplicationBuilder.build(); } }