Cannot create online meeting with Enterprise Application
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- azure, java
- Bereich
- api, authentication, authorization
Rechercherichtung
Beginnen Sie mit dem Aufruf GraphServiceClient users().byUserId(...).onlineMeetings().post(meeting) und dem gemeldeten Fehler zur application access policy. Überprüfen Sie die im Issue beschriebene Konfiguration der service-principal-Berechtigungen und der Exchange Online-Richtlinie und verifizieren Sie anschließend die Anfrage anhand des dokumentierten application-permission-Flows. Als erledigt gilt die Identifizierung, ob die SDK-Anfrage oder die externe Richtlinienkonfiguration den Fehler verursacht.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
We're unable to create an online meeting using the Microsoft Graph SDK with a service principal. We're following the application permissions flow (not delegated) and calling the Graph API with the correct scopes and payload, but the request fails withthe follwing error
com.microsoft.graph.models.odataerrors.ODataError: No application access policy found for this app.
Expected behavior
Online meeting created
How to reproduce
- Added deps
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.15.4</version>
</dependency>
<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph</artifactId>
<version>6.36.0</version>
</dependency>
- Created an Enterprise Application and corresponding Service Principal.
- Granted all required application permissions, including:
OnlineMeetings.ReadWrite.AllUser.Read.AllCalendars.ReadWrite- All permissions have been admin-consented.
- Created a mail-enabled security group and added all relevant users to it.
- Used the following code to try to create an online meeting:
@Override
public Event createCall(CallDTO callData) throws TechnicalUserIsNullException {
try {
GraphServiceClient graphClient = accessTokenGenerationService.getGraphServiceClient();
User organizerUser = accessTokenGenerationService.getTechnicalUser();
// 2.Create online meeting
OnlineMeeting meeting = createOnlineMeeting(callData, graphClient);
OnlineMeeting createdMeeting = graphClient.users()
.byUserId(organizerUser.getId())
.onlineMeetings()
.post(meeting);
} catch (ODataError error) {
log.error("Error calling Microsoft Graph API: {} - {} - {}", error.getError().getCode(), error.getError().getMessage(), error.getError().getTarget());
log.error("Error calling Microsoft Graph API Inner clientRequestId: {} - requestId: {} - OdataType: {}", error.getError().getInnerError().getClientRequestId(), error.getError().getInnerError().getRequestId(), error.getError().getInnerError().getOdataType());
throw error;
} catch (Exception ex) {
log.error("Error creating Teams call: {}", ex.getLocalizedMessage(), ex);
throw ex;
}
}
private OnlineMeeting createOnlineMeeting(CallDTO callData, GraphServiceClient graphClient) {
OnlineMeeting meeting = new OnlineMeeting();
meeting.setStartDateTime(OffsetDateTime.of(callData.from(), ZoneOffset.UTC));
meeting.setEndDateTime(OffsetDateTime.of(callData.to(), ZoneOffset.UTC));
meeting.setSubject(callData.title());
meeting.setParticipants(buildMeetingParticipants(callData.organizerEmail(), callData.otherParticipants(), graphClient));
meeting.setAllowedLobbyAdmitters(AllowedLobbyAdmitterRoles.OrganizerAndCoOrganizersAndPresenters);
meeting.setRecordAutomatically(callData.recordCall());
return meeting;
}
private MeetingParticipants buildMeetingParticipants(String organizer, List<String> otherParticipants, GraphServiceClient graphClient) {
MeetingParticipants participants = new MeetingParticipants();
participants.setOrganizer(createMeetingParticipantInfo(organizer, graphClient, true));
participants.setAttendees(otherParticipants.stream()
.map(email -> createMeetingParticipantInfo(email, graphClient, false))
.toList());
return participants;
}
Then i created the application policy using powershell on portal azure
Install-Module ExchangeOnlineManagement
Connect-ExchangeOnline
New-ApplicationAccessPolicy `
-AppId 41874eeb-9f6f-45b6-bb20-becdcb0d461e `
-PolicyScopeGroupId group-for-meeintg@example.com `
-AccessRight RestrictAccess `
-Description "A sample description"
SDK Version
6.36.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Vorherrschende Sprache
- Java
- Sterne
- 444
- Forks
- 154
- Ø Merge
- 18 Std. 28 Min.
- Gemergte PRs (30 T.)
- 4
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 Kommentar ·
Alle Issues in microsoftgraph/msgraph-sdk-java
Ähnliche Issues
-
certification
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 80/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Offenbug ecr
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Needs: Triage Type: Feature request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
github/copilot-sdk#2760 ·