Can't set up access
I need to create a server application that will create meetings on behalf of the program itself (non-delegated, with authentication only within the program). To do this, I registered at https://portal.azure.com/ and in Azure Active Directory, I selected "App Registrations" and created a new application with the "Accounts only in this organizational directory" account type (only "Catalog" by default - one client). On the application's edit screen, I went to API permissions, clicked on "Microsoft Graph," and added "OnlineMeetings.ReadWrite.All" and "User.Read.All" as application permissions. Then I returned to the API permissions screen and clicked on "Grant admin consent."I created a new client secret in "Certificates & secrets." To obtain a token, I use a POST request to https://login.microsoftonline.com/02cbf2ff-553d-40c5-8ef3-2904824a1688/oauth2/token, and the response contains the access token.Next, I tried to create a meeting using a POST request to https://graph.microsoft.com/v1.0/users/3fc50c3a-881a-4980-a33d-adcb90474a62/onlineMeetings. In the headers, I included:
Authorization: Bearer {token received earlier}
Content-Type: application/jsonThe response I receive is:
{
"error": {
"code": "General",
"message": "No Application Access Policy found for this app.",
"innerError": {
"request-id": "ddc99409-00e6-4332-98ee-3755686f64e1",
"date": "2023-06-22T09:11:25",
"client-request-id": "ddc99409-00e6-4332-98ee-3755686f64e1"
}
}
}To resolve this error, I started configuring the application access policy for online meetings or virtual events. I opened PowerShell and executed the command "Connect-MicrosoftTeams." A login form appeared, and I entered the "User principal name" taken from Azure users: alik8939_hotmail.com#EXT#@alik8939hotmail.onmicrosoft.com. After entering the password, I saw the correlation ID for this request: f6d1f68a-45f1-45ae-826b-d02b2687a15a.Then I entered the command "New-CsApplicationAccessPolicy -Identity Test-policy -AppIds "84d33356-5576-4224-b0e0-70f10b3bf7a4"." The AppIds were obtained from Azure App Registrations, specifically the Application (client) ID. However, I received the error message: "New-CsApplicationAccessPolicy: The remote server returned an error: (404) Not Found."My Azure account is ******@hotmail.com.