Microsoft.Graph.ServiceException: 'Error occured when making a request with the page iterator

Mewan Rangana 0 Reputation points
2024-01-15T06:05:51.5633333+00:00

I have a issue when getting the folders form a share point library.

I get the error in this part of my code.
This is the error
unauthenticated : Invalid audience Uri '00000003-0000-0000-c000-000000000000'.

var pageIterator = PageIterator<DriveItem, DriveItemCollectionResponse>
    .CreatePageIterator(_graphClient, response,
    (children) =>
    {
        childrens.Add(children);
        return true;
    });

await pageIterator.IterateAsync();

This was working fine and there wasn't any changes recently in the code.
I already have included those scopes in the graph calls

MsGraphScope = new string[] { "user.read", "sites.read.all", "sites.manage.all", "offline_access" };

Please assist me to understand the problem here.

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Azizkhon Ishankhonov 540 Reputation points
    2024-01-15T23:38:48.6066667+00:00

    Hi, Please make sure that your authentication works properly. Clear browser caches. After that obtain the token and verify that the aud field is what you are expecting.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.