I noticed very weird issue. If user has Microsoft Account and accept invitation, system remove permission to all shared documents.
- upload document:
await _graphClient.Drives[_driveId].Root.ItemWithPath(itemWithPath) .Content.Request() .PutAsync<DriveItem>(fileStream)
- create guest:
await _graphClient.Invitations.Request().AddAsync(new Invitation() { InvitedUserEmailAddress = email, InvitedUserDisplayName = displayName, SendInvitationMessage = false, InviteRedirectUrl = NullableString.Parse(ConfigurationManager.AppSettings["AppAddress"]) });
- add permission:
await _graphClient.Drives[_driveId].Items[driveItemId].Invite( recipients, requireSignIn: true, roles: new[] { "write" }, sendInvitation: false ).Request().PostAsync();
In onedrive on document I see user is granted, but once user open url to document and accept invitation redemption to azure active directory see error, no access to document. In azure directory user first is marked (source) as Invited User than Microsoft User if accept terms.
If I repeat the same scenario once user accept invitation redemption than access stay as expected. So what is wrong? Why system are removing access?