setting up linked in post node in my self-host n8n keep failing, i have configure client id, client secret, add callback url,
disabled organization and legacy,
when i press connect, it opens the linked in login page correctly, after approving i keep getting this error page Error: Unauthorized,
You cannot use a raw http://192.168... address for LinkedIn. You have three main options:
Reverse Proxy (Recommended): Use Nginx Proxy Manager​, Traefik​, or Caddy (all available as apps on TrueNAS) to map a domain (e.g., n8n.yourdomain.com) to your local IP and generate a free SSL certificate via Let’s Encrypt.
Cloudflare Tunnel: If you don’t want to open ports on your router, use a Cloudflare Tunnel (cloudflared). This provides a secure https URL that points directly to your TrueNAS instance.
Tailscale Funnel: If you use Tailscale, you can use “Funnel” to expose your local n8n instance via a secure HTTPS address.
Once you have an HTTPS address, you must tell n8n to use it for all OAuth callbacks. In your TrueNAS/Docker environment variables, add or update:
Key:WEBHOOK_URL
Value:https://n8n.yourdomain.com/ (Replace with your actual secure URL)
Restart your n8n container after changing this variable.
@rick can you expand the more details if possible it may show us more info, I suspect the issue might be that you don’t have the correct “products” enabled on the LinkedIn side.
One thing to add if you go the Cloudflare Tunnel route, since it bit me and the symptom looks exactly like this "Unauthorized" screen even after HTTPS is working.
If you put the tunnel behind Cloudflare Access (a login screen in front of n8n), Access also challenges the OAuth callback path, and LinkedIn's popup cannot log in through that challenge. So the ?code= never reaches n8n and you get "Error: Unauthorized, the window can be closed now."
Two things to check once you are on an https URL:
Set WEBHOOK_URL (and N8N_EDITOR_BASE_URL if you use it) to the exact public https host, then restart the container. The redirect has to land on the same host the login started on, or the session and the OAuth state will not match and you get Unauthorized. A raw 192.168 IP fails for that reason too, on top of LinkedIn refusing a private http address.
If you use Cloudflare Access, add a bypass for /rest/oauth2-credential/* (a policy with "everyone", or a service token) so Access does not intercept the callback. On a plain Cloudflare Tunnel with no Access policy, you can skip this.
And the redirect URL you register in LinkedIn's Auth tab is the full path, exact match and https: https://your-host/rest/oauth2-credential/callback.