Support Auth HTTP Headers (e.g. Cloudflare ZTN) on credentials for self-hosted resources (e.g. Ollama)

The idea is:

Hello N8N community!

Currently, self-hosted resources like Ollama can’t be used when requiring authentication (installed on another server that N8N or from the N8N Cloud).

The credentials are not supporting adding optional HTTP headers (basic auth or Zero Trust Network like Cloudflare).

I’m pretty sure that there is other self-hosted resources that we can’t reach when protected them with authentication based on HTTP headers, specially when using Langchain models.

My use case:

I have deployed Ollama on an instance than is protected by Cloudflare Zero Trust Network and N8N is deployed to another instance using also Cloudflare ZTN.

Due to the lack of a way to add the two HTTP headers to the Ollama credentials, I can only use the generate Ollama API endpoint with the HTTP Request node by adding them to the request.

To use the Langchain node with the chat Ollama node, I need to set the credentials (URL only) and the execution is blocked by Cloudflare ZTN since the headers are not send.

I think it would be beneficial to add this because:

Most of the N8N Cloud and self-hosted users will be blocked by this limitation of not be able to use HTTP Headers Authentication.

I took the case of Ollama credentials, but I’m pretty sure that other credentials would benefit to have support to additional HTTP Headers (ZTN, custom auth, etc.)

It needs to be generic enough to work on more credentials. That means adding the name of the HTTP header and its value.

The format of the Cloudflare ZTN for example is the following:

CF-Access-Client-Id: xxxxxx
CF-Access-Client-Secret: xxxxxx

Update: there is already request to use Ollama with HTTP headers for remote installation:

Any resources to support this?

Are you willing to work on this?

I will be happy to create the PR to implement it for Ollama credentials, but I need to know if there is already a work in progress on this topic.

Ideally, it would be great to be able to select the Custom Auth credentials to the Ollama Chat instead of the current one only or add the same flow as the HTTP Auth credentials, but with additional fileds, to the Ollama credentials.

Like I said, I’m pretty sure this use case will be also on other credentials if you protect them with as minimum HTTP Basic auth or Zero Trust Network.