var address = new java.net.InetSocketAddress("proxy.example", 8080);
var tokenProxy = new com.azure.core.http.ProxyOptions(
    com.azure.core.http.ProxyOptions.Type.HTTP, address);
var tokenHttp = new com.azure.core.http.netty.NettyAsyncHttpClientBuilder()
    .proxy(tokenProxy).build();
var credential = new com.azure.identity.ClientSecretCredentialBuilder()
    .tenantId(tenantId).clientId(clientId).clientSecret(clientSecret)
    .httpClient(tokenHttp).build();

String[] scopes = {"https://graph.microsoft.com/.default"};
String[] allowedHosts = {"graph.microsoft.com"};
var auth = new com.microsoft.kiota.authentication.AzureIdentityAuthenticationProvider(
    credential, allowedHosts, scopes);
var graphHttp = com.microsoft.graph.core.requests.GraphClientFactory.create()
    .proxy(new java.net.Proxy(java.net.Proxy.Type.HTTP, address))
    .build();
var graph = new com.microsoft.graph.serviceclient.GraphServiceClient(auth, graphHttp);

നിലവിലുള്ള ടെനന്റ്/ക്ലയന്റ് ക്രെഡൻഷ്യലുകൾ ഉപയോഗിക്കുക. ടോക്കൺ, Graph എന്നീ രണ്ട് എൻഡ്പോയിന്റുകൾക്കും പൊതു ഇടനിലക്കാർ അനുവദനീയമായിടത്ത്, HTTP പ്രോക്സി പട്ടിക പങ്കിട്ട അക്കൗണ്ട്-രഹിത HTTP പ്രോക്സി വിലാസത്തിന് സ്ഥാനാർത്ഥികളെ നൽകുന്നു. കാണിച്ചിരിക്കുന്ന പബ്ലിക്-ക്ലൗഡ് സ്കോപ്പുകളും അനുവദിച്ച ഹോസ്റ്റും ഉദ്ദേശിച്ച ക്ലൗഡ് വിന്യാസവുമായി പൊരുത്തപ്പെടണം.

httpClient(tokenHttp) Azure Identity-യുടെ ടോക്കൺ റൂട്ട് നൽകുന്നു. GraphClientFactory.create() API പ്രോക്സി ചേർക്കുമ്പോൾ Graph-ന്റെ സ്വതേയുള്ള മിഡിൽവെയർ നിലനിർത്തുന്നു; പ്രവർത്തനങ്ങൾക്ക് അവസാന graph ക്ലയന്റ് ഉപയോഗിക്കുക.

പ്രാമാണീകരിച്ച ഇടനിലക്കാരന് രണ്ട് പാതകളിലും അക്കൗണ്ട് ക്രമീകരണം ആവശ്യമാണ്: Azure ProxyOptions.setCredentials, OkHttp proxyAuthenticator എന്നിവ അവയുടെ ബന്ധപ്പെട്ട ട്രാൻസ്പോർട്ടുകൾ നൽകുന്നു. കാഷ് ചെയ്ത ടോക്കൺ കോൺഫിഗർ ചെയ്യാത്ത ടോക്കൺ പാത മറയ്ക്കാം.

സ്വന്തമായ ട്രാൻസ്പോർട്ടുകൾ കമ്പോണന്റിനൊപ്പം നിലനിർത്തി വൃത്തിയാക്കുക. പഴയ TokenCredentialAuthProvider ബിൽഡറുകൾ മറ്റൊരു SDK തലമുറയെ ലക്ഷ്യമിടുന്നു.

അനുബന്ധ ലേഖനങ്ങൾ