Docs

Add TikTok as a social connection

You will learn the following:

  • Use TikTok ID to authenticate users with OAuth.

Enabling OAuth with TikTok allows your users to sign up and sign in to your Clerk app with their TikTok account.

Configure for your development instance

Due to TikTok's requirement to verify URL ownership for all redirect URLs, TikTok cannot be used with shared credentials in development environments. This is because individual users can't verify ownership of the Clerk development URL (accounts.dev).

However, TikTok can still be used in development environments if you create a sandbox app and configure custom credentials. In this case, there is no need to verify redirect URLs in the sandbox environment. Instead, you can invite users who are allowed to sign in.

It is recommended to test this integration in a staging or preview environment, as shared credentials require URL verification to function properly.

Configure for your production instance

To make the setup process easier, it's recommended to keep two browser tabs open: one for your Clerk Dashboard and one for your TikTok Developer Portal.

Enable TikTok as a social connection in Clerk

  1. In the Clerk Dashboard, navigate to the SSO Connections page.
  2. Select Add connection and select For all users.
  3. In the Choose provider dropdown, select TikTok.
  4. Ensure that both Enable for sign-up and sign-in and Use custom credentials are toggled on. Keep the modal and page open.

Create your app in TikTok

Tip

If you're creating an app as an organization rather than as an individual developer, you must first create an organization. For guidance on which option to choose, refer to TikTok's guide on working with organizations.

  1. On a separate page, go to the TikTok Developer Portal and sign in.
  2. In the top-right, select Developer Portal, then select Manage apps. You'll be redirected to the Manage apps page.
  3. Select Connect an app. Complete the form then select Confirm. You'll be redirected to your App details page.
  4. In the Basic information section, complete the form.
  5. Select the Verify URL properties under any of the URL fields to verify your app URL. A modal will open.
  6. Select Verify properties. For the property type, select either Domain to verify ownership of the enter website, including subdomains, or URL prefix to verify ownership of a specific part of the website (e.g., example.com/shop/). See the TikTok guide for more information.
  7. Enter your website and select Verify.
  8. Follow the instructions in the modal to verify your domain with your host provider. After entering the necessary information in your hosting provider's DNS settings, select Verified. Once your property is verified, select Ok.
  9. Select Submit for review. Keep this page open.

Note

Your app needs to be reviewed by TikTok before the registration completes. This process may take a few days.

Set the Client ID and Client Secret in your Clerk Dashboard

  1. In your TikTok app's App details page, select the icons next to the Client key and Client secret to reveal them. Copy these values.
  2. Navigate back to your Clerk Dashboard where the modal should still be open and paste these values into the respective fields.
  3. Select Add connection.

Note

If the modal or page is not still open, navigate to the SSO Connections page in the Clerk Dashboard. Select the TikTok connection. Under Use custom credentials, you can paste the Client ID and Client Secret into their respective fields.

Test your OAuth

The simplest way to test your OAuth is to visit your Clerk app's Account Portal, which is available for all Clerk apps out-of-the-box.

  1. In the Clerk Dashboard, navigate to the Account Portal page.
  2. Next to the Sign-in URL, select Visit. The URL should resemble:
  • For development – https://your-domain.accounts.dev/sign-in
  • For production – https://accounts.your-domain.com/sign-in
  1. Sign in with your TikTok account.

Feedback

What did you think of this content?

Last updated on