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

Wondering if we need to update the sample code

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
untriaged
Dominant language
Java
Stars
79
Forks
82
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.