Azure-Samples / Azure-Samples/remote-mcp-apim-functions-python

JWT has an invalid signature

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

説明

The access token stored in the APIM cache which is mapped to session key has an invalid signature. Though the JWT itself is valid, however, does not have any valid signature and it is causing the issue at various downstream levels where JWT validation failing.

![Image](https://github.com/user-attachments/assets/4ca099ed-f28e-4e8e-8666-39753b4e0a99)

![Image](https://github.com/user-attachments/assets/65c265b3-41b4-46ae-9213-c8a20bb5ec0e)

Further using the token in exchange flows through MSAL or Azure.Identity also deems the signature invalid -

![Image](https://github.com/user-attachments/assets/b31c67e6-c7be-47eb-9d01-4a75c37c424b)

Is it because we are assigned APIMGatewayURL as an issuer while the issuer in the token is different (https://sts.windows.net/tenantId) ?
@prjhawar @jukasper - Kindly help with this issue.

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

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

調査の方向性

ソースファイル、テスト、エントリポイントのいずれも指定されていません。まず APIM の issuer 設定と、キャッシュされたトークン内の issuer および signature の claims を比較し、次に MSAL または Azure.Identity を通じた検証を追跡してください。完了の条件は、issuer/signature mismatch が特定され、影響を受ける設定またはフローについて修正が確認されていることです。

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

評価

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

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

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