microsoftgraph / microsoftgraph/msgraph-sdk-java

Owners not assigned correctly in bulk member add & inconsistent response behavior

未關閉
#2,562 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

status:waiting-for-triage type:bug
主要語言
Java
星號
444
分支
154
平均合併
18 小時 28 分鐘
30 天內合併 PR
4

描述

Describe the bug

When creating a Team and adding members using the Microsoft Graph SDK for Java, there are two issues:

  1. Bulk add does not correctly assign owner roles
    When using the bulk member add endpoint (/teams/{id}/members/add), users specified with the role "owner" are not assigned as owners.
    Instead, they are added as regular members, even though the request payload explicitly defines the owner role.

This behavior occurs without any error or exception, making it difficult to detect programmatically. As a result, affected users do not receive the required owner permissions.

  1. createTeam does not return the created Team
    The SDK method used to create a Team suggests that a Team object will be returned. However, the response does not contain the created Team resource.
    Instead, the Team ID must be retrieved indirectly (e.g., via response headers or additional handling), which is not aligned with common framework expectations.
Expected behavior
  1. Correct role assignment in bulk add
    When adding members via the bulk endpoint, the roles provided in the request (e.g., "owner") should be correctly applied.
    Users specified as owners must be assigned owner permissions within the Team.

  2. Ability to define members and roles during Team creation
    It should be possible to fully define all desired members and their roles (including owners) directly during Team creation, without requiring a separate bulk add step.

  3. Consistent and intuitive SDK response behavior
    The createTeam operation should either:

  • return the created Team entity, or
  • clearly reflect (through API design and SDK behavior) that no resource is returned.

Ideally, the SDK should align with common framework standards and not imply a return value that is not actually provided.

How to reproduce

Create Team
POST https://graph.microsoft.com/v1.0/teams
Content-Type: application/json

{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"displayName": "Test Team",
"members": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('john.doe@xy.com')"
}
]
}
Retrieve Team ID
The Team ID is extracted from the response (e.g., via response headers / response options).
Bulk add members
POST https://graph.microsoft.com/v1.0/teams/{team-id}/members/add
Content-Type: application/json

{
"values": [
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"roles": [],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('some.user@xy.com')"
},
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"roles": [],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('the.user@xy.com')"
},
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"roles": [],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('john.smith@xy.com')"
},
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('one.owner@xy.com')"
},
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('another.owner@xy.com')"
}
]
}

SDK Version

6.62.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

The log contains no errors, which is also a real problem.

Configuration
  • OS: Windows Local and a Debian on the production VM but the behavior is on both systems the same
    -Within a permission management workflow implemented in a Spring Boot 3.5.x application, Teams are programmatically created and populated in a Job with members using the Microsoft Graph SDK for Java.
Other information

No response

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先追蹤 createTeam 和 /teams/{id}/members/add 的 SDK 入口點,以重現請求和回應標頭作為基準。將 owner 角色的處理方式和建立回應與 Microsoft Graph 的行為進行比較,然後確認每項差異屬於 SDK 還是服務。兩項已回報行為的修正範圍都已確認且可測試,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java, spring-boot
領域
api, backend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。