8

I am having a look at the new TikTok Login Kit for Web and am stuck on the redirect step.

Similarly to all oAuth-based services out there, when you register your app, they should ask for valid redirect URLs. In the case of TikTok, they ask for redirect domains, as shown below:

enter image description here

Then, based on their official documentation, you just need to call

https://open-api.tiktok.com/platform/oauth/connect/client_key=client_key&response_type=code&scope=user.info.basic&redirect_uri=redirect_uri&state=state

I get to the TikTok authorization page, confirm, then instead of being redirected to https://testing.mydomain.com/signup/tiktok I receive the following error:

{"data":{"captcha":"","desc_url":"","description":"Illegal redirect link","error_code":10006},"message":"error"}

Tested multiple times, also adding a final slash to the redirect URL (https://testing.mydomain.com/signup/tiktok/ ) in case it was a requirement, but always get the same error.

Also tried with the production domain in case they check if the domain can be reached from public network.

Andrea Olivato
  • 2,450
  • 1
  • 18
  • 30

3 Answers3

5

Turns out "Redirect Domain" actually means "Redirect URL". If you add the full URL of the redirect (in my case https://testing.mydomain.com/signup/tiktok/) it'll work.

It's probably just a labelling issue... it's a full URL, not just the domain.

Update: Please refer to @mariussabo new answer as this has been fixed.

Andrea Olivato
  • 2,450
  • 1
  • 18
  • 30
5

After researching this for a couple of hours and tried Andrea's workaround, it just seems that TikTok fixed their issues and now it works as expected. So, for anyone searching a solution to this issue, I managed to get it working with the following values:

Callback URL: https://example.com/auth

*Redirect domain example.com dev.example.com

mariussabo
  • 66
  • 1
  • 1
    This approach no longer works - the callback URL (i.e., redirect_uri) must now match EXACTLY to whatever is entered in the Settings page as a redirect domain - so paths/protocols included in the callback will result in an error. I started a new thread on this here: https://stackoverflow.com/questions/73338099/tiktok-login-kit-web-flow-keep-getting-redirect-uri-error-code-10006 – Eugene Blinn Aug 16 '22 at 18:11
  • 1
    there is no callback URL thing in the app's configuration page in TikTok, how to let it to redirect to my mobile app ? – JAHelia Sep 10 '22 at 13:31
  • 1
    tiktok is out of control with this redirect_uri issue and I'm lost at this point as well – daily-learner Oct 31 '22 at 20:52
1

Ran into this question as well while I was filling out the Tiktok developer application form. For anyone else that has the same question, it seems like the redirect domains field should be any redirect domains that your app will use. So for example, prod.example.com and dev.example.com would both be fine to include there. However, Callback URL is actually meant to be your webhook endpoint, so it should be something like https://dev.example.com/webhook-endpoint.

Reference: https://developers.tiktok.com/doc/webhooks-overview.

Beverly
  • 11
  • 2
  • Hello, it looks like my configurations are correct based on your answer. I have the settings saved yet i get the same redirect error, does tiktok require you to resend for review after making any change? I see that button up there. is that the case? – fokosun Jul 18 '22 at 01:22