Sporadic ClaimsChallengeRequiredException using client secret authentication in newer versions of SDK
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- azure, java, kotlin, spring-boot
- 領域
- api, authentication, backend
調査の方向性
ClientSecretCredentialBuilder と applicationsWithAppId ヘルスチェックを使用する GraphServiceClient bean から始めます。SDK バージョン 6.12.0 と 6.18.0 の認証動作を比較し、同じ service principal を使用するすべてのインスタンスが一緒に ClaimsChallengeRequiredException を受け取る理由に焦点を当てます。断続的に発生する例外を再現するか、そのリグレッションを特定し、検証済みの修正を利用できる状態になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
After upgrading the library to version 6.18.0 (or any version other than 6.12.0), we sporadically encounter ClaimsChallengeRequiredExceptions.
When this issue arises, the com.microsoft.graph.serviceclient.GraphServiceClient consistently returns ClaimsChallengeRequiredException, and this can persist for several hours before the problem resolves itself. The issue may or may not recur the following day, with occurrences ranging from twice a day to once every four days.
Sample response from the Graph API:
{
"error":{
"code":"InvalidAuthenticationToken",
"message":"Exception of type 'Microsoft.Graph.AGS.Contracts.ClaimsChallengeRequiredException' was thrown.",
"innerError": {"date":"2024-10-25T12:28:03", "request-id":"f9d0585e-13fc-45d5-8e04-052b9768bcc0", "client-request-id":"83e18f5d-2547-4cac-8aa1-3b11f3a8148d"}
}
}
Downgrading to 6.12.0 will cause the problem to not appea, while other applications running 6.18.0 for the same service principal still get the error.
Expected behavior
We do not expect to get sporadic ClaimsChallengeRequiredException's
How to reproduce
In our spring boot kotlin application we have defined a spring bean for a GraphServiceClient like this
@Bean
fun graphServiceClient(): GraphServiceClient {
return GraphServiceClient(
ClientSecretCredentialBuilder()
.clientId(azureProperties.clientId)
.clientSecret(azureProperties.clientSecret)
.tenantId(azureProperties.tenantId)
.build(),
SCOPES,
)
}
We also have a health check that pings
graphServiceClient.applicationsWithAppId(azureProperties.clientId).get()
to verify that the client works.
With this we can expect the exception to be thrown at any moment / random.
The following image displays occurances of this exception the last 14 days.
SDK Version
6.18.0
Latest version known to work for scenario above?
6.12.0
Known Workarounds
We have currently two workarounds:
- Restarting the application, which reinitializes the GraphServiceClient bean
or - Wait an hour or two for the problem to disappear
Other information
When running multiple instances of the same application, using the same service principal, all instances will be affected at the same time, when this issue occurs.
- 主要言語
- Java
- スター
- 444
- フォーク
- 154
- 平均マージ
- 18時間 28分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-java のほかの issue
-
status:waiting-for-triage type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
status:waiting-for-triage type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
microsoftgraph/msgraph-sdk-java#2589 · コメント 1 件 ·
microsoftgraph/msgraph-sdk-java の issue をすべて見る
似ている issue
-
certification
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's オープンbug ecr
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Needs: Triage Type: Feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/copilot-sdk#2760 ·