Forum Discussion
tom_schm
Feb 11, 2025Copper Contributor
Registered App > Grant Permission to OneDrive?
Hello everyone,
I'm trying to connect an automation platform (N8N) to our OneDrive.
What I did:
- registered an app
- create a secret for it
- gave n8n the client id and secret value
- gave the app various api permissions (i.e. files.readwrite.all)
- created an app role (users & apps)
- added myself as an owner
Error I'm running into:
"Forbidden - perhaps check your credentials?
You do not have access to create this personal site or you do not have a valid license."
I know that I have all the needed permissions, because in another automation platform which is more hands-off (Make.com), everything works fine. Unfortunately, I need it in N8N, which requires more setup.
My question:
What permissions do I need to give the registered app?
Did I miss a step in the grand scheme of things?
Thanks a lot in advance!!
Tom
- micheleariisSteel Contributor
Hey! From what you’ve described, it definitely looks like the issue is caused by the lack of a OneDrive license. With the Power Automate Free license, unfortunately, you don’t have access to OneDrive for Business, which is required for the API and everything you’re trying to do. Yes, the Office 365 E3 license includes OneDrive for Business and would solve the problem. Without this (or an equivalent license), the user cannot access or create their personal OneDrive site. The PowerShell command to force OneDrive provisioning (Request-SPOPersonalSite) only works if the user has a valid license. Without it, it won’t run at all. I’d suggest temporarily assigning the Office 365 E3 license to the user you’re testing with, just to see if that fixes the issue. Once the license is active, log in manually to https://portal.office.com/onedrive to trigger the initial OneDrive setup. After confirming that it works, you can decide on the most suitable solution.
Alternatively, you could use the OneDrive for Business Plan 1 license, which is cheaper and only gives you OneDrive (1 TB of storage) without the other Office apps
- micheleariisSteel Contributor
Hey, the error you’re seeing usually happens when the account doesn’t have OneDrive fully set up or lacks a valid license. It’s not just a permissions issue.
Here’s what you can do:
1 - Force OneDrive provisioning:
Make sure the account has a valid OneDrive for Business license. To force the creation of the personal site (OneDrive), you can use PowerShell:
- Install the SharePoint Online module: Install-Module -Name Microsoft.Online.SharePoint.PowerShell
- Connect to your SharePoint tenant: Connect-SPOService -Url https://<tenant>-admin.sharepoint.com
Replace <tenant> with your tenant name.
- Request personal site provisioning: Request-SPOPersonalSite -UserEmails "<user>@domain.com"
This command forces the creation of the user’s personal site (OneDrive).
Alternatively, ask users to log in to https://onedrive.office.com, which will trigger the automatic creation of their OneDrive.2. Check permissions:
Ensure the app has Files.ReadWrite.All and Sites.ReadWrite.All permissions. If you’re working in a user context, use delegated permissions, not just "app-only" ones.
3. Admin consent:
Verify that all required permissions have received admin approval.- tom_schmCopper Contributor
Hi, really appreciate your response !!
I have the permissions configured like this and clicked on 'admin approval':
Still doesn't work. Or am I missing something here?
So the issue is probably with the OneDrive setup, right?
For me it says the URL https://onedrive.office.com is not valid.
I've checked in the 365 Admin Panel and it seems like I indeed only have a 'Power Automate Free' license.
We have a Office 365 E3 license left. Do I really need this? Would need to ask my client if this is okay for them.
Does the thing with PowerShell work even without the license? Never used PowerShell before.
Thanks a lot !