I’m currently trying to integrate with the TikTok API to upload videos using the Content Posting API, specifically the /v2/post/publish/inbox/video/init/ endpoint.
I’ve successfully set up OAuth2 credentials in n8n using the “OAuth2 API” type for the User Access Token (Authorization Code flow). I went through the TikTok connection process, and the credential shows as successfully connected within n8n. I’ve made sure to include the necessary scopes in the credential configuration.
However, I’m facing an issue with the HTTP Request node:
I configure the node with the correct POST method and the TikTok /init/ URL.
Under “Authentication”, I select “Generic Credential Type”.
For “Generic Auth Type”, I choose “OAuth2 API”.
I select my successfully connected “tiktok” credential from the dropdown.
I’ve also added the required Content-Type header (application/json; charset=utf-8) and the JSON body with source_info.
The Problem: When I execute the node, TikTok returns an error indicating a missing token (e.g., “Unable to sign without access token”). To investigate, I replaced the TikTok URL with a temporary webhook.site URL and ran the node again. The request captured on webhook.site confirms that the Authorization: Bearer header is completely missing. It seems n8n isn’t automatically adding it, even though the correct OAuth2 credential is selected.
Troubleshooting Steps Taken:
Confirmed the OAuth2 credential is valid and shows as connected in the n8n Credentials section.
Double-checked that the correct credential is selected in the HTTP Request node.
Tested connectivity by successfully reconnecting the credential (“Connect my account”).
Deleted and completely recreated the OAuth2 credential from scratch.
Deleted the original HTTP Request node and created a brand new one, re-configuring it.
Tested with the simplest possible HTTP Request node (just the URL and the selected OAuth2 credential, targeting webhook.site) - the Authorization header was still missing.
I’m currently using n8n version [1.85.4 ] ([self-hosted ]).
Has anyone encountered a similar issue where the HTTP Request node fails to add the Authorization header for a selected and connected OAuth2 credential? Any ideas what might be causing this or how to resolve it?
Still looking for solutions Jun 25…
I stucked at same step that credential connected by token was missing.
Start to question if the auth flow really succeeded. Or if the uniquess of tiktok makes the token caching and inserting handled incorrectly due to its non standard auth specification.
TLDR
After a week grinding, it think its a dead end. Meaning even if you get the auth flow and token management working, you will not be able to post video publically to tiktok using APIs as it’s banned by TikTok.
My experiment
I created my local backend to proxy the auth and token request flow, and also added video upload function. My goal was to expose locally this endpoint so that n8n http node can simply use it to do all the work. Everything worked, and I am tyring to upload video now. Then i found out that, in order to post videos publically into an account, you will need to submit your API client to tiktok for audit. And they explicitly clamined that:
“API Clients must not be limited to test applications and should be intended for a wide audience, not limited to internal groups/private use.
Not acceptable: A utility tool to help upload contents to the account(s) you or your team manages. ”
So, n8n flow for auto video posting to own account is not allowed. So I expect in the furture even if n8n provided the official tiktok node, it will be limited to “read” rather than “write” actions. (eg. you can only getting user infos, metadata etc)
So sad, so bad, and I dont understand why tiktok does this as other platforms do not.
Hey! I wanted to say there is at least one bug on n8n with Bearer Auths. On a separate closed thread, it is mentioned as fixed from 1.93, but on my self hosted 1.94 the bug is still there.
Bug: In the HTTP node v4.2, selecting “Predefined Credential Type” in Authentication, with Bearer Auth, and then the token, will NOT work. Doing so actually calls the endpoint with
authorization `Bearer ={{$credentials.token}}`
Workaround: Select “Generic Credential Type” instead. Then you can pick Bearer Auth, and the same token already saved. This way, n8n actually passes the token value instead of {{$credentials.token}}
Probably not related to your use case with oauth. Using webhook.site as you did is a good way to quickly debug if n8n is passing correctly auth parameters. You could also try making the curl command directly from your machine to see the host’s response (tiktok or other). Good luck, I also struggled with non standard auth specs for Alicloud until eventually making it.
I followed your steps and it’s very easy to follow. But I get this error:
We couldn't log in with TikTok. This may be due to specific app settings.
If you're a developer, correct the following and try again:
* redirect_uri
Refer to our [Developer Documentation](https://developers.tiktok.com/doc) for more information.
Hi peter, this error usually means the redirect url is not added or not matching. Make sure in the Tiktok app setting you added the (yourhost)/auth/callback in the platform section and login kit section(my backend handles the redirect from tiktok to finish Oauth token exchange). TK only allows exact match of this url.
I forget to highlight this point in my video.
🚀 TikTok OAuth2 Server running at http://localhost:7777
📖 Health check: http://localhost:7777/health
🔐 Perform OAuth flow: http://localhost:7777/auth/login
🛑 Shutdown: POST http://localhost:7777/shutdown
So the Perform Oath flow will get my domain n8n.example.com/auth/login
and this also add in the redirect of Login Kit on TT Dev Portal?
In most case you dont need to change .env. It is used to deploy the backend with non-default settings.
For redirect URL in TT portal, it only needs the */auth/callback endpoint. If your n8n is locally deployed:
if its natively deployed: then in TT dev portal you just need to add http://localhost:7777/auth/callback.
If you deployed with docker, then http://(your machines local address):7777/auth/callback. (which should look like 192.168.x.x)
If you are using the n8n cloud, then this might require extra work. It will need the public IP address from your machines that run this backend, which IMO is not secure unless you have a secure server that you feel confident to use.