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

Wondering if we need to update the sample code

オープン
#4 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
untriaged
主要言語
Java
スター
79
フォーク
82
PR マージ指標
30日以内にマージされた PR はありません

説明

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!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

リンクされている GraphHelper.java の 46 行目付近のエントリポイントから始め、クライアントの構築方法を、提案されている GraphServiceClient パターンと比較します。java.net.SocketTimeoutException: Read timed out を再現し、その後、サンプルの更新が必要なのか、それともこの問題に個別の使用方法のガイダンスが必要なのかを判断します。原因と解決策が文書化されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。