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

EasyAuth returns 403 forbidden

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

説明

I have made some changes to try use EasyAuth instead of function key. Copilot suggested using the same app registration so that has been my main attempt. I get everything working except at the very end, it returns 403 when trying to get the list of MCP tools after getting authenticated. The error in the function app:
```
2025-07-18T21:54:34Z [Information] Authorization failed. These requirements were not met:
Handler assertion should evaluate to true.
2025-07-18T21:54:34Z [Information] Executing ForbidResult with authentication schemes (WebJobsAuthLevel, Bearer).
2025-07-18T21:54:34Z [Information] AuthenticationScheme: WebJobsAuthLevel was forbidden.
```

I also made changes to persist the ClientInfo by adding http endpoints to store and fetch the client information. These http endpoints are in the same function app and they do not get rejected. Why do only the MCP endpoints fail the authentication scheme with the exact same token?

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

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

調査の方向性

まず、ClientInfo の保存と取得に使用される HTTP エンドポイントと MCP エンドポイントの認証を比較し、次に tools-list リクエストを再現して、表示された function-app の認可ログを確認します。同じトークンが MCP リクエストで受け入れられ、WebJobsAuthLevel forbid レスポンスが返されなければ完了です。

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

評価

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

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

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