Forum Discussion
Base URL used for Multi Tenants
const msalConfig = {
auth: {
// 'Application (client) ID' of app registration in Azure portal - this value is a GUID
clientId: "b9c6e65c-cbf5-4ffb-998f-6b1114440a93",
// Full directory URL, multi-tenant application. (MUST be /common)
authority: "https://login.microsoftonline.com/common",
// Full redirect URL
redirectUri: your_server_name, // <--- same as in the app registration in azure.
},
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}`
);
- AlexD775Jul 15, 2024Copper ContributorI have the exact same issue. The documentation for the v8 file picker is extremely frustrating because it leaves out major steps for common cases, e.g. this multitenant case. That is, I want to be able to set up my Application so that business users (from ANY tenant) can log in to their MS accounts using OAuth, then I can launch the filepicker control to allow the user to choose their files.
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.