Azure-Samples / Azure-Samples/ms-identity-msal-java-samples
Wondering if we need to update the sample code
- Langage dominant
- Java
- Étoiles
- 79
- Forks
- 82
- Métriques de merge des PR
- Aucune PR mergée en 30 j
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!
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par le point d’entrée lié GraphHelper.java vers la ligne 46 et comparez la construction de son client avec le modèle GraphServiceClient suggéré. Reproduisez java.net.SocketTimeoutException: Read timed out, puis déterminez si l’exemple doit être mis à jour ou si le problème nécessite des instructions d’utilisation distinctes ; le travail est considéré comme terminé lorsque la cause et la résolution sont documentées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100