OneDrive / samples

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

FilePicker v8 using Web instead of SPA AAD Authentication #29

Closed damacisaac closed 1 year ago

damacisaac commented 1 year ago

Describe the bug In the setup instructions, it says to create a Single-page application registry. We've already integrated the v7 file picker with a Web AAD Application for authentication and would like to re-use this with the new file picker, however we end up with authentication errors if we use the token generated with a Web authentication flow.

Is it possible to use a Web access token to instantiate the v8 file picker?

To Reproduce Steps to reproduce the behavior:

Expected behavior The picker should work using either SPA or Web AAD authentication?

Screenshots

Screenshot 2023-02-15 at 5 06 34 AM
patrick-rodgers commented 1 year ago

The picker should work with any valid MSAL setup that can get tokens for SharePoint. The instructions are specific to getting the samples setup. You can see how we are configuring MSAL in the sample. So our samples likely won't work with other configurations - your application should be able to use whatever it needs.

damacisaac commented 1 year ago

@patrick-rodgers thanks for the response. So the issue doesn't seem to be related to the application type.

Next question:

Our current setup is using the OAuth 2.0 with manually crafted http requests (we're not using MSAL or ADAL). The token we receive through this process works with FilePicker v7 but not with FilePicker v8. Any idea why that would be the case?

patrick-rodgers commented 1 year ago

If the token is valid, and for the correct audience (you can see how we setup the scope using the resource from the command here) it should work fine.

patrick-rodgers commented 1 year ago

Closing this issue as answered. If you have additional questions or we did not answer your question, please open a new issue, ref this issue, and provide any additional details available. Thank you!