Local n8n with Ngrok integrate OneDrive (Personal)

I am trying to integrate with OneDrive (Personal, not company) with my local n8n, not Cloud n8n.

I read that I need to have the Azure acccount to create the App Registration which will give the ClientID (or Application ID) and Client Secret, which I can able to get those two. After I have those two keyed in and click ‘Connect my account’ which I choose my personal account, it throws me the below message:

We’re unable to complete your request

unauthorized_client: The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at Microsoft Azure.

Check Supported Account Types in App Registration:

When registering your application in Azure, you must select the correct “Supported account types.” For personal OneDrive integration, you need to select:

Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g., Skype, Xbox).

Then update your Redirect Uri to match the callback.

If you cannot update the app, just create another one.

Then update your Redirect Uri to match the callback. –> update in Azure App Registration? I could not find where to update? Do you mean update this “http://localhost:5678/rest/oauth2-credential/callback”?

It gives this error: You can’t sign in here with a personal account. Use your work or school account instead.

If you cannot update the app, just create another one.

Wait… isn’t your n8n instance public?

No localhost.

I only have n8n localhost, as my cloud n8n is already expired. Can you help confirm n8n localhost will not work for OneDrive integration?

I can confirm that it won’t work.

You will need ngrok or similar service to expose your localhost to internet.

1 Like

Thanks for the confirmation, I expect it too. Cheers.

1 Like

is it complicated to use ngrok with n8n localhost? what are the steps involved?

  1. Download ngrok for your system(Windows ,Linux etc…), is easy to follow their docs.
  2. After running the ngrok service(eg: ngrok http YOUR-URL 5678), you will get an URL (like ngrok-random-words.app/dev), that will be your localhost new address.
  3. Copy that address, and set in your n8n .env variable ‘‘WEBHOOK_URL=NGROK-URL-HERE”
  4. Restart your n8n instance , and go to that URL.

where do I copy this?

https://somethinghere88.ngrok-free.dev/rest/oauth2-credential/callback

here, that http://localhost:5678/rest/oauth2-credential/callback is not able to change to anything.

Couse you have to set in your n8n Environment variables the WEBHOOK_URL=ONLY-NGROK-URL (eg: WEBHOOK_URL=https://lucky-customer.ngrok-free.dev ), Restart you n8n and that URL you see in node will change by itself.

P.S if u used npm to install n8n , then you have that .env file in the .n8n folder(if not create it).

If u used Docker, then you need to set in the .yml file.

do you need to append “/rest/oauth2-credential/callback” after the “.dev”?

I have used npm to install n8n, and I have just added .env file which contains the WEBHOOK_URL. When n8n restart, it still shows http://localhost:5678/rest/oauth2-credential/callback

I copy and paste this https://somethinghere88.ngrok-free.dev to browser, it links to cloud n8n, which my is already expired.

NO.

download your workflows, then do a fresh install of n8n… otherwise is already a lot to debugg here for a simple task.

Ensure the .env file is in the same directory where you run the n8n command.( in the .n8n folder with a dot . before the n8n folder name).

or n8n start --env-file=.env.

or another way export WEBHOOK_URL=https://yourdomain.com/

then start n8n

And start the ngrok like that in the folder with the ngrok exe file .\ngrok http --url=https://ungranulated-blabal-custom.ngrok-free.dev 5678

I got it correct here:

This will then show this in Browser, which I already forget the password for Cloud n8n, and that Cloud n8n is already expired.

Next command n8n user-management:reset

After running this, restart n8n and open the link again. You should see the signup screen to create a new owner account (email and password).

This process does not require your old cloud login or password, and you do not need to recover your expired credentials. Just set up a new account as the instance owner.

Note: clear cookies as well, to avoid further issues.