microsoftgraph / microsoftgraph/msgraph-sdk-java

Guest User Receives 401 "accessDenied" Error When Accessing Shared Files via Microsoft Graph API Despite Valid Authentication

オープン
#2,518 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

status:waiting-for-triage
主要言語
Java
スター
444
フォーク
154
平均マージ
18時間 28分
マージ済み PR(30日)
4

説明

Refernce similar to this in Sharepoint: https://github.com/OneDrive/onedrive-api-docs/issues/1039

Pattern of failure:
Initial API calls fail with 401
After manually visiting the file through SharePoint web UI, API calls work temporarily (1-4 hours)
API calls then fail again after a period of inactivity
Web UI access requires device code authentication flow
What works:
✅ Basic Microsoft Graph calls (/me) succeed
✅ Accessing files through SharePoint web UI works
✅ Token refresh succeeds and produces valid access tokens
What fails:
❌ Microsoft Graph API calls to /shares/{share-id}/driveItem

Issue Type: Microsoft Graph API Authentication
Affected Service: SharePoint Online for Business
User Type: Guest User (External/Cross-Tenant)
Authentication Method: OAuth 2.0 with Refresh Token
API Endpoint: /shares/{share-id}/driveItem

Problem Description:
As a guest user in your tenant, I am unable to programmatically access shared files via the Microsoft Graph API, despite having:

Valid authentication tokens
Proper API permissions granted
Ability to access the same files through the web UI

Detailed Symptoms:

API calls fail with 401 error:

{
"error": {
"code": "accessDenied",
"message": "There has been an error authenticating the request."
}
}

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ソースファイルやテストは指定されていません。まず、ゲストユーザーの更新済みトークンを使って /shares/{share-id}/driveItem リクエストを再現し、次に /me および SharePoint の Web UI からのアクセスと比較してください。その際、リンクされた SharePoint issue をコンテキストとして使用します。完了の条件は、繰り返し発生する 401 レスポンスの原因が文書化され、解決策が検証されていることです。

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

評価

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

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

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