I have two domains and one account under each domain, "user1@aaa.com" and "user2@bbb.com".
As user1@aaa.com, Microsoft Graph API can read/write files under "SharedGroup" just as API doc says.
However, as user2@bbb.com, API accessing "SharedGroup" using following API
https://graph.microsoft.com/v1.0/groups/<group id>/drive/root/children
(I got the Group ID by login as user1@aaa.com)
returns unauthenticated error, with the URI correctly returned,
{
"error": {
"code": "unauthenticated",
"message": "Invalid audience Uri 'https://aaa.sharepoint.com/'.",
"innerError": {
"request-id": "5f1c1e32-fce1-4bb8-986a-92067cdd32d9",
"date": "2018-10-29T22:47:13"
}
}
}
How do I read/write shared files from Groups as Guest Account from another domain using Graph API? or any API?
Can you include your authentication code? I'd guess you're authenticating against the /common endpoint instead of a tenanted endpoint, but guests need to be authenticated against the tenanted endpoint in order to access resources in the tenant they've been invited to.