Azure-Samples / Azure-Samples/ms-identity-msal-java-samples

Wondering if we need to update the sample code

Aperta
#4 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
untriaged
Lingua principale
Java
Stelle
79
Fork
82
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

https://github.com/Azure-Samples/ms-identity-msal-java-samples/blob/9c173abaa9643d8d4b5e5507196f7b3c33a5688b/3.%20Java%20Servlet%20Web%20App%20Tutorial/2-Authorization-I/call-graph/src/main/java/com/microsoft/azuresamples/msal4j/helpers/GraphHelper.java#L46

I followed this pattern in my code and I'm facing an issue where I got the "java.net.SocketTimeoutException: Read timed out" exception, then I google the issue, somebody from Microsoft suggested this way

```
public static GraphServiceClient getGraphClient(String accessToken, boolean force) throws ClientException {
if (client == null || force) {
client = GraphServiceClient.builder()
.authenticationProvider(new MsalGraphAuthenticationProvider(accessToken))
.buildClient();
}

return client;
}
```

Basically create few clients as less as we can, but I still got that exception constantly.

Any thoughts as to how to resolve this exception?
Thanks!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.