POST Message to Teams Channel with Application-only Permissions Not Allowed for Regular Use Cases
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 18/100
Hướng nghiên cứu
Bắt đầu với ví dụ GraphServiceClient bằng Java trong issue và tài liệu Microsoft Teams được liên kết về việc nhập tin nhắn. Xác minh các hạn chế được nêu trong tài liệu đối với các yêu cầu POST cho tin nhắn kênh sử dụng application-only authentication, cũng như các tùy chọn delegated authentication khả dụng cho headless services. Được xem là hoàn tất khi đã ghi lại một phương thức xác thực được hỗ trợ hoặc xác nhận rằng không tồn tại workaround được hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe the problem.
Hello,
I am attempting to use the Microsoft Graph API to send messages to a Microsoft Teams channel using application-only authentication with the following code:
import com.azure.identity.ClientSecretCredential;
import com.azure.identity.ClientSecretCredentialBuilder;
import com.microsoft.graph.models.ChatMessage;
import com.microsoft.graph.models.ItemBody;
import com.microsoft.graph.serviceclient.GraphServiceClient;
public class GraphClientExample {
public static void main(String[] args) throws Exception {
final String clientId = "****-2189-4dab-a9b8-28dc0f57b181";
final String tenantId = "****-4b22-4755-a153-421da388048a";
final String clientSecret = "F1p8Q~**************";
final String[] scopes = new String[] { "https://graph.microsoft.com/.default" };
final ClientSecretCredential credential = new ClientSecretCredentialBuilder()
.clientId(clientId).tenantId(tenantId).clientSecret(clientSecret).build();
if (null == scopes || null == credential) {
throw new Exception("Unexpected error");
}
final GraphServiceClient graphClient = new GraphServiceClient(credential, scopes);
ChatMessage chatMessage = new ChatMessage();
ItemBody body = new ItemBody();
body.setContent("Hello World");
chatMessage.setBody(body);
ChatMessage result = graphClient.teams().byTeamId("459b419d-9d5e-42cd-b59d-*********").channels().byChannelId("19%********************Gu3neGtMFiU8PSRzeaR-uL5AWU1%40thread.tacv2").messages().post(chatMessage);
}
}
However, I am encountering the following error:
Message POST is allowed in application-only context only for import purposes. Refer to https://docs.microsoft.com/microsoftteams/platform/graph-api/import-messages/import-external-messages-to-teams for more details.
From what I understand, the Microsoft Teams API restricts POST requests in the application-only context to migration or import purposes. This means I am unable to use application-only authentication to send messages to a Teams channel.
Question:
Is there a recommended way to send messages to Microsoft Teams channels using application-only authentication in scenarios other than data migration?
If delegated permissions are required, is there an alternative method to authenticate using delegated permissions in a headless application or server environment?
Any insights or workarounds would be greatly appreciated!
Thank you!
Describe the solution you'd like.
Question:
Is there a recommended way to send messages to Microsoft Teams channels using application-only authentication in scenarios other than data migration?
If delegated permissions are required, is there an alternative method to authenticate using delegated permissions in a headless application or server environment?
Any insights or workarounds would be greatly appreciated!
Additional context?
No response
- Ngôn ngữ chính
- Java
- Star
- 444
- Fork
- 154
- Merge trung bình
- 18 giờ 28 phút
- Pull request đã merge (30 ngày)
- 4
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
Error in PATCH onlineMeeting Đang mởstatus:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 bình luận ·
Tất cả issue của microsoftgraph/msgraph-sdk-java
Issue tương tự
-
Bug Java Platform: Java
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/sentry-java#6138 · 1 bình luận ·
-
bug needs triage p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 bình luận ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/rocketmq-dashboard#4654 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100