'Cannot get installed apps for user | Microsoft Graph API

My application should retrieve all installed apps for every user in the AAD.

According to this docs the application permissions are:

TeamsAppInstallation.ReadForUser.All,
TeamsAppInstallation.ReadWriteSelfForUser.All, 
TeamsAppInstallation.ReadWriteForUser.All

The endpoint I'm calling is

GET https://graph.microsoft.com/v1.0/users/{user-id}/teamwork/installedApps

or in .net:

var options = new TokenCredentialOptions { AuthorityHost = AzureAuthorityHosts.AzurePublicCloud };

var authProvider = new ClientSecretCredential(_tenantId, _clientId, _clientSecret, options);

GraphServiceClient graphClient = new GraphServiceClient(authProvider);

var apps = await graphClient.Users[id.ToString()].Teamwork.InstalledApps.Request().GetAsync();

It doesnt matter which permission I configure, I always get following error:

Microsoft.Graph.ServiceException: 'Code: AuthenticationError Message: Error authenticating with resource


Solution 1:[1]

would you check with your admin whether you have a valid subscription for this user? at the same time you can also check the same API on graph explorer - https://developer.microsoft.com/en-us/graph/graph-explorer .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vicky kumar