How to Authenticate an HTTP Request with OAuth 1.0 Two-Legged in n8n?

Hi Community,

I’m looking for a solution to authenticate an HTTP request using OAuth 1.0 Two-Legged in n8n, following the documentation here:
ImmobilienScout24 Two-Legged OAuth Guide

Since n8n only provides built-in support for OAuth 1.0 Three-Legged, I need to manually generate the required authentication headers.

What I Need

I need help setting up an HTTP Request node in n8n that includes the correct OAuth 1.0 signature. Specifically, I need to:

  1. Generate the OAuth 1.0 signature using HMAC-SHA1.
  2. Include the required parameters:
  • oauth_consumer_key
  • oauth_nonce
  • oauth_signature_method (HMAC-SHA1)
  • oauth_timestamp
  • oauth_version (1.0)
  • oauth_signature
  1. Format the request correctly so that the API accepts it.

What I Have Tried

I attempted to use a Code node (JavaScript) to generate the signature and pass it as a header in the HTTP Request node, but I’m not sure if I’m constructing it correctly.

Has anyone successfully implemented OAuth 1.0 Two-Legged authentication in n8n?
Would love to see examples or best practices for this!

Thanks in advance! :blush:

Information on your n8n setup

  • n8n version: 1.72.1
  • Running n8n via: npm
  • Operating system: Raspian (bullseye)/Linux 11

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

This is how I did it with Twitter’s OAuth:

The HTTP request gives an output as:

oauth_token=<token>&oauth_token_secret=<secret>&oauth_callback_confirmed=true

which then I need to use to initiate the OAuth screen.

@hrishikesh Thank you very much for your help. I will test it. For Security reasons, so i have the credentials directly in the n8n node?

Yeah for the most part, storing the tokens in n8n is safe, but if you don’t trust it, you’d have to store them elsewhere and fetch them every time using HTTP request or something.

If it works, please consider marking it as a solution :slight_smile:

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