Search code examples
javascriptonedriveopenid-connectfilepicker

OneDrive Javascript Filepicker 7.2 with accesstoken


Through a separate call I have a (valid) refreshtoken for a user (using OIDC). Using this refreshtoken, I retrieve a new accesstoken and now want to use that in the filepicker, to enable automatic sign-on without having to enter username and password.

The Microsoft documentation mentions the possibility of using such an accesstoken, but only with an endpointhint. When retrieving the refreshtoken, I can see that this is a businessaccount. This, then leads me to the following setup

var odOptions = {
    clientId: office365ClientId,
    action: "download",
    multiSelect: false,
    advanced: {
        accessToken: office365AccessToken
        , endpointHint: "https://usersdomain-my.sharepoint.com/personal/useridentifier/"
        , loginHint: "userLoginAccountName"
        , isConsumerAccount:false
    },
    success: onOneDriveSuccessFunction,
    cancel: onOneDriveCancelFunction,
    error: onOneDriveErrorFunction,
};
OneDrive.open(odOptions);

However, what ever I do, I still get a login screen. What am I doing wrong?


Solution

  • Looking at the actual javacsript, it looks like it's not possible. So it's a 'feature' ?