n8n can manage multiple connections to a single service (such as Asana), but users would typically have to log into n8n to perform the authentication (at least for OAuth2). Or in other words all users would also have to be n8n users.
Hello, is there a way to use n8n with different OAuth2.0 credentials (for different users, without adding them to n8n users) while using n8n cloud?
If i didn’t make any sense, here is an example:
A user would connect his account with my service, then i would pass his credentials to n8n and use the nodes and flows n8n has, with his credentials. Then repeat for a different user who connected his account as well…
That would theoretically be possible, but it would be some work. Currently, n8n takes care of everything and OAuth is literally the definition of “not fun”. You would have to write all of that yourself (obviously not all, as you could also use libraries). After you then collected that “information” you could use the API to create that credentials in n8n and use it like any other.
"message": "request.body.data is not allowed to have the additional property \"token\",request.body.data requires property \"clientId\",request.body.data requires property \"clientSecret\",request.body.data requires property \"scope\""
So i have my clientId, clientSecret, and the scope. But how can i pass the rest of the information i acquired so i can use the n8n Google Driver node/connector?
Looks like an additional key has to get added to enable that. Currently the checking seems to be to strict and only supports the ones which are defined as parameter and not the ones that get dynamically added. Will be the same issue for all OAuth2 credentials. We will have a look at that.
Btw. this is how the data structure actually looks like:
And thanks for the great support, not gonna lie, n8n is a beast of a software, and yet with so much more potential to unlock. Adding a way to programmatically fine control auths would unlock so much more potential with n8n
Yeah, you guys created something extremely helpful and useful!
The oauthTokenData is what i meant by it. I recommend announcing this feature clearly in a “why choose n8n?” page, super cool
So to reiterate, and accept your next answer as a solution for this thread
In the next release, which is within a week or so, n8n will support a way to programmatically set OAuth data in credentials as well. N8n nodes will be able to use those oauth credentials.