|
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!
ms-identity-msal-java-samples/3. Java Servlet Web App Tutorial/2-Authorization-I/call-graph/src/main/java/com/microsoft/azuresamples/msal4j/helpers/GraphHelper.java
Line 46 in 9c173ab
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
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!