0

I'm trying to use the filepicker from OneDrive API, and I want to let the users of my app open file from their onedrive buisness or sharepoint account only, because I want to create a sharable link inside the organization scope only. So, I want to prevent the user to connect to this personal onedrive account. But I do not find any way to do that, the user can connect to is onedrive personal account, and I'm getting an error response when he choose file because, obviously, the onedrive account isn't an organization. I just want to prevent the user to use a personnal acount, then, he can't be wrong.

Moreover, the error message received is not useful at all to know that the user choosed a file from a personnal acount, so I can't use that as workaround to tell my user what he is doing wrong...

var odOptions = {
            clientId: "",
            action: "share",
            multiSelect: false,
            advanced: {
                redirectUri: "blabla/authResponse.php",
                createLinkParameters: { type: "view", scope: "organization" }
            },
            success: function(files) {
                console.log(files);
                $("").val(files.value[0].webUrl);
                $("").val(files.value[0].name);
            },
            cancel: function() { /* cancel handler */  },
            error: function(error) { console.log(error); }
        };
        OneDrive.open(odOptions);

Thanks!

Dev
  • 2,428
  • 2
  • 14
  • 15
Deewens
  • 107
  • 2
  • 11
  • I doubt that we have a setting or policy exists in the Onedrive. In case if its not available and still you want this feature to be considered by Microsoft then create a Microsoft Uservoice - https://onedrive.uservoice.com/forums/262982-onedrive – Dev Oct 12 '20 at 12:51
  • Oh :( ! And Here is a workaround? – Deewens Oct 13 '20 at 08:52
  • So you just want your users to log in with their O365 work account rather than personal Microsoft Account right? If my understanding is correct, you should choose the first option or the second option while creating the Azure AD app, which will now allow personal account to log in. See https://i.stack.imgur.com/Ppesu.png. – Allen Wu Oct 15 '20 at 05:48

0 Answers0