Forum Discussion
Base URL used for Multi Tenants
I am facing the same issue. I am integrating the file picker in my website for multi tenants app but don't have generic baseUrl for picker. Sample code given by Microsoft has suggested to use hard coded value for baseUrl for testing which will work for single tenant app but no mention of how to replace this for multi tenant app. https://learn.microsoft.com/en-us/onedrive/developer/controls/file-pickers/?view=odsp-graph-online%20 and https://github.com/OneDrive/samples/blob/master/samples/file-picking/javascript-basic/index.html#L8 . (Note: I have already changed my msalConfig as suggested by mgouker). And For personal account baseUrl - https://onedrive.live.com/picker is not working
const url = combine(
baseUrl,
`/_layouts/15/FilePicker.aspx?${queryString}`
);
I have everything working with single tenant and consumer accounts. With business accounts, I am correctly launching the OAuth dialog using the authority of `https://login.microsoftonline.com/common`. However, from there I need to know the user's tenant to use as the baseUrl for opening the FilePicker (as Tornado_339 mentioned) and there is no doc on how to do that. In addition, there are some settings in the picker config that expect tenant-scoped values, and it's not at all clear how to get these. I think I'm making more progress reverse engineering the OneDrive picker config as integrated with ChatGPT than I am trying to find any docs from Microsoft on this issue.