-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
Description
Line 46 in 9c173ab
| return GraphServiceClient.builder().authenticationProvider(new MsalGraphAuthenticationProvider(contextAdapter)) |
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<Request> 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!