Add TikTok as a social connection
You will learn the following:
- Use TikTok ID to authenticate users with OAuth.
Before you start
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
- In the Clerk Dashboard, navigate to the SSO connections page.
- Select Add connection and select For all users.
- In the Choose provider dropdown, select TikTok.
- 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
- On a separate page, go to the TikTok Developer Portal and sign in.
- In the top-right, select Developer Portal, then select Manage apps. You'll be redirected to the Manage apps page.
- Select Connect an app. Complete the form then select Confirm. You'll be redirected to your App details page.
- In the Basic information section, complete the form.
- Select the Verify URL properties under any of the URL fields to verify your app URL. A modal will open.
- 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. - Enter your website and select Verify.
- 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.
- Select Submit for review. Keep this page open.
Set the Client ID and Client Secret in your Clerk Dashboard
- 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.
- Navigate back to your Clerk Dashboard where the modal should still be open and paste these values into the respective fields.
- Select Add connection.
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.
- In the Clerk Dashboard, navigate to the Account Portal page.
- 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
- Sign in with your TikTok account.
Feedback
Last updated on