When attempting to add a permission to a OneDrive file using the add permission API, an error occurs indicating the need to configure B2B collaboration settings correctly. The specific error message states:
Please configure B2B collaboration settings correctly and troubleshoot first, "https://aka.ms/b2b-troubleshoot". Error from Entra B2B: No inviterEmail for invitation with 500 Internal Server Error.
{
"error": {
"code": 500,
"status": "Internal Server Error",
"cloudResponse": {
"error": {
"code": "sharingFailed",
"message": "Please configure B2B collaboration settings correctly and troubleshoot first, "https://aka.ms/b2b-troubleshoot". Error from Entra B2B: No inviterEmail for invitation",
"innerError": {
"date": "2024-05-14T12:30:29",
"request-id": "03535a28-f6f5-4349-b5dd-972afdbf2bac",
"client-request-id": "03535a28-f6f5-4349-b5dd-972afdbf2bac"
}
}
}
},
"requestId": "32e3f7e5-5700-4ed4-9cf8-62239582f562"
}
API Documentation: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_invite?view=odsp-graph-online
The request which I used is set as requireSignIn as true and sendInvitation as false. Also, I'm adding a user who is not in the same organization/tenant. In this case I'm getting above error. But when I'm setting requireSignIn as false and sendInvitation as true, then it is adding the permission but the webUrl returned in this case is becoming public which I don't want.
Also, when I'm trying this schenario with different accounts, in some accounts it's working fine but in some accounts it's not working as expected. So, I want to know is there any specific settings/configurations to be done at the organisation/tenant level using which I'll be able to share file with users which are not in our organisation and webUrl returned would be private to the user to whom file is shared.