Set Credentials programmatically

Hi,

I’m investigating the possibility of setting Query Auth credentials programmatically. In my business case, I have several customers accessing an HTTP endpoint that requires each customer’s specific API key to access only their own data.

I found this old post:

Set Credentials programmatically [GOT CREATED]

I’d like to know if anyone has already solved this kind of flow.

I’m on n8n cloud latest version

Many thanks!

What is the node type?

Also how are you selling this to customers? In many cases reselling access to internal automations would fall under needing an embedded or whitelabel license.

The node is a custom Https node. I’m not reselling access. The use case is a Real Estate AI assitant providing user assitance by answering questions about properties of Real Estate agencies (my customers). To get info about properties I need to access to the HTPPS node with each Real Estate agency’s keys, given that the service is a centralized one, where multiple agencies can access.

In that case, how do you make the HTTP requests now? Just to help guide if this is doable.

You could easily dynamically enter if its something like a Bearer or Basic authorization header, and you can just store the keys on a google sheet or database with the names of the agency.

Hi @ThinkBot, thanks for your response.

I’m making the HTTP request using a Generic Credential Type with Query Auth, setting up the API key credentials for each agency.

While searching the community for a similar case, I found this thread: Select credentials via expression, which addresses exactly the same issue.

In that thread, they mention this workflow: Set credentials dynamically using expressions | n8n workflow template, which could be an option, although it carries the risk of exposing credentials publicly.

Thanks!

1 Like

Hi,

You are able to make credentials through the n8n node. Unfortunately you cannot dynamically use them.

I have solved this by using JWT auth, but that is rather advanced (essentially handling all of the auth manually)

1 Like

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