
- TICTOC COM FULL
- TICTOC COM CODE
So, yes, you can add in redirect_url parameter.
From my tests, I could add whanever url path I wanted, the only constraint was that the domain should match with step 2. Add the Login Kit product to your app and set the Redirect domain field with your host domain, for example:. Like said: make sure your app is in Live in production status (I couldn't find anything in the documentation about why Staging apps don't work). In my case, the integration worked after doing following steps: I'll just reiterate I consider this a very "hacky" approach handling callbacks and would definitely not want to use something like this in production. If you're looking for a shot-term hack I'd recommend creating a dedicated app on AWS or Heroku with a clean domain (e.g., ) and then redirect to either your dev or production environment by appending a prefix to the "state" query (e.g., "dev_"). I suggest if you're having the same issue you email them as well and maybe even link this StackOverflow question so that maybe it will get higher priority if enough people message them about it. I've been emailing with the TikTok team - their email is - and proposed the two solutions I mentioned above. My gut feeling is telling me that the error is not on my part and this is actually a bug on TikTok's API - my guess is it can be addressed either by changing the front-end on the Settings page to allow for path/protocols (I think this is the ideal approach) or to change their backend so that any redirect uri is checked such that it must include 1 of the listed redirect domains. At some point recently, the front-end business logic was changed such that you could only enter a domain (e.g., ) on the Settings page without any protocols - however TikTok's backend logic was never updated so during the Login flow they are still checking against an EXACT match for whatever was saved in their DB as the redirect uri - this would explain why an app that was previously using the API with a redirect uri that DOES include protocols (e.g., for their redirect uri is ) continues to work and why for any app attempting to save redirect WITH protocols are getting the error message screen. My guess is that before - on the Settings page you had to enter the FULL redirect URL (not just the domain) and whatever redirect uri was included in the authorization query was checked against this value which was saved in TikTok's database (whatever was entered in the Settings page when path/protocol were allowed). So if you entered "" in Settings then redirect_uri can only be "" not "/tiktok". The redirect_uri you include in your server flow must match EXACTLY to whatever value you entered in "Registered domains" in the Settings page.Even though when you create a new app you may see client_key and client_secret show up don't let that fool you - Login Kit WILL NOT WORK unless your app is submitted and approved Make sure that the status of your app is "Live in production" and not "Staging".The issue is still there - still showing error message no matter what domain / callback URL I useįirst off - I was able to get the authentication/login screen to finally show up. I submitted the app for review and was approved so the status is now "Live in production" instead of "staging". Res.cookie('csrfState', csrfState, ) Ĭonst redirect = encodeURIComponent(` let url = '' Any help on this would be much appreciated! const CLIENT_KEY = 'my_key'Ĭonst csrfState = Math.random().toString(36).substring(2)
Similar to the question asked here I have the correct redirect domain listed in tiktok settings and the redirect_uri is basically just "domain/tiktok" but no matter what I do I get the same error message:īelow is my backend code - it's basically exactly the same as what is listed in the tiktok docs. I'm having an issue getting Login Kit to work.