Having trouble implementing TikTok's Login Kit on localhost

2.6k Views Asked by At

All of the tutorials and Stack Overflow answers I've been seeing have addressed production environments, but haven't addressed any redirects and callbacks for a local environment. I'd love some help on how to do this locally!

Attaching pics of my current TikTok Developer application configuration and the error page I get from TikTok — all with fake tld & query params

The redirect_uri query param I'm using on localhost:

waitlist.localhost:3000/auth/tiktok/callback

TikTok Developer Callback Settings TikTok Auth Error Page

2

There are 2 best solutions below

0
On

At the moment tiktok do not support localhost as callback url or I just don't know how to =) You can put record on /etc/hosts like 127.0.0.1 waitlist.ex.com

And then setup your ruby server with ssl or just spin up nginx with ssl and proxy to your app.

I used second option for testing tiktok oauth locally

Hope this help you

2
On

I ran into the same issue, I use ngrok to open a tunnel to my local dev env. If you pay for it you can set some fix domains that you can put into the redirection domain list in TikTok.