1

I had used this code previously to use Tiktok OAuth in my react native app. But now tiktok is shifting to v2 from 12 September,2023. I want to replace this code of mine with new code.

const baseUrl = 'https://open-api.tiktok.com/platform/oauth/connect/';
  const scope = 'user.info.basic';
  const state = Math.random().toString(36).substring(7);
  const queries = `client_key=${clientId}&response_type=code&scope=${
    scope}&redirect_uri=${redirectURI}&state=${state}`;
  return `${baseUrl}?${queries}`;

I want a replacement for this url https://open-api.tiktok.com/platform/oauth/connect/ but i am not able to find it in Tiktok documentation. On tiktok only this url is given https://www.tiktok.com/v2/auth/authorize/. My code is not working with this url.

Please guide me to migrate my code to v2 auth.

With this v2 Url https://www.tiktok.com/v2/auth/authorize/. I am getting this error Image

1 Answers1

0

yeah, you can use https://www.tiktok.com/v2/auth/authorize/ this API to for authentication but here are some query params that need to be added like client_key, scope,redirect_uri, state,response_type enter image description here

but yeah there is more to it you need to verify your scops and redirect uri in your developer account and also follow this https://developers.tiktok.com/doc/login-kit-web/ guideline to integrate TIKTOK in your platform and after calling this API https://www.tiktok.com/v2/auth/authorize/, you need to call this API to Fetch an access token using an authorization code. https://developers.tiktok.com/doc/oauth-user-access-token-management

so I think both API will cover your TIKTOK account connection.