OneDrive / samples

Contains samples, scenarios, and guidance for integrating with OneDrive and SharePoint drives, drive items, and files.
MIT License
58 stars 59 forks source link

OneDrive File Picker gives 404 #73

Open Orangeapplebot opened 7 months ago

Orangeapplebot commented 7 months ago

Describe the bug Onedrive FilePicker gives 404. When using the exact implementation in the examples, the auth works correctly, but picker opens with a 404. I have made an application from Microsoft EntraID. I have set-up web redirect uris. My client and backend do the oAuth and finally, the access token is passed to my client. Using this access token, I'm trying to open the onedrive file picker, but it gives a 404. Even using the onedrive js samples, I'm getting the same error.

To Reproduce I replaced my client id in onedrive samples. I was asked to add a client secret to it. I only want onedrive and not sharepoint, so I changed my scopes with "Files.Read.All Sites.Read.All". After which, I realised I was getting the access token directly, and didn't need to exchange it for idToken.

    const resp = await app.loginPopup(authParams);
    app.setActiveAccount(resp.account);
    const accessToken = resp.accessToken;

So, this code works the oauth for me. I'm also getting a refresh token along with it, which is weird, because Im not asking for "offline_access" in scopes or am I acking for consent. The entry_point I'm using is: "https://onedrive.live.com/picker" The rest of the code is the same as the onedrive js sample. I'm getting a 404 after this point, my onedrive popup opens, and I'm getting, the data couldn't be loaded. It asks me to redirect to onedrive, where I'm already signed in, which means, the access token is passed correctly. Is the url I'm using incorrect somehow?

Expected behavior I should be seeing the onedrive file picker popup where the user can choose which files/folders they want to select.

Screenshots image

skulltech commented 3 months ago

i'm facing the exact same issue. Any clarity on this will help a lot. @Orangeapplebot did you find a solution for this?

Tjerkdb commented 3 months ago

Same problem on my side