Using n8n API to create oAuth tokens

Describe the issue/error/question

Because this is my first post, I need to say thanks for the great product, especially because it’s built in Berlin! Anyhow, I would love to make use of the already existing oAuth flow in n8n to create oAuth token for users to store them by initializing the flow in self-made frontend.

Here is an example of what I mean:

  1. Let’s say I have already set up a Google Drive node with “OAuth Redirect URL”, “Client ID” and “Client Secret”.
  2. Let’s assume I have a fronted, which shows an “Authenticate with Google” button.
  3. After the user is clicking the button, redirect to Google Auth Page.
  4. User clicks accept
  5. Callback to n8n and storing the response into Supabase.
  6. User redirect to frontend where the button click happened.

So basically, I would like n8n handle the whole flow in the background. Additional data I would need to pass from the client (browser) to n8n is the Supabase id of a particular user, so that the Supabase node knows where to store the response.

I’ve seen this post which is the right direction, but this one expects already the auth token.

Information on your n8n setup

  • n8n version: 0.213.0
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm,, desktop app]: Kubernetes

Thanks :pray:

Hi @NameRequired, welcome to the community and thank you for the kind words :tada:

Afaik this isn’t an option n8n currently offers. I have brought up the idea of easily letting non-n8n users authenticate credentials for n8n users a couple of times internally, but it never gained traction.

I believe from the product side of things such a feature would live with our Adoption team. Maybe @Niklas_Hatje can re-check this when he has a bit of time?

Hey @MutedJam,

Thanks for your reply. That would be definitely very interesting and extremely helpful. To give you some context, I’ve been checking Passportjs and Supabase etc. and I couldn’t find anything valuable.

You folks already have a really solid API portfolio with plenty of functions and so far, I had the feeling that it limits the n8n user to only be able to use all those APIs only with their own data.

Imagine how much business value you are creating by a comparable small change. All the other features are already there and can be used to create a pretty sophisticate applications.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.