Azure-Samples / Azure-Samples/ms-identity-msal-java-samples
Wondering if we need to update the sample code
- Vorherrschende Sprache
- Java
- Sterne
- 79
- Forks
- 82
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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!
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.