Skip to main content

TikTok — Authentication

B
Written by Ben Keeling

A plain-language overview of the access we request, what each permission lets us do, who on your team should connect, and what to expect during setup.



​

TikTok or TikTok Ads?

Medialake has two separate TikTok integrations:

  • TikTok (this page) syncs your organic content: the videos posted to a TikTok account, with their like, comment, share and view counts.

  • TikTok Ads syncs your advertising data from TikTok for Business ad accounts. See TikTok Ads — Authentication.

They are connected separately, sign in through different TikTok services, and each has its own access keys. You can use either or both.


​

What to expect

Connecting takes a couple of minutes. When you connect TikTok in Medialake, you're redirected to TikTok's official authorization page, where you log in and see the access being requested: two read-only permissions, explained in the table below. You approve it yourself and can revoke access at any time. We never see or store your password: the login happens entirely on tiktok.com, and once you approve you're returned to Medialake.

We follow the principle of least privilege: we only request the access the work needs. We never post, edit, or delete videos, and we never comment, like, or message on your behalf. Account and video details are read through TikTok's official Display API; each video file is downloaded from the share link the API returns for it.

 You                    Medialake                  TikTok
  │  connect source         │                         │
  │────────────────────────▶│                         │
  │  redirect to TikTok     │                         │
  │◀────────────────────────│                         │
  │  log in & grant access  │                         │
  │──────────────────────────────────────────────────▶│
  │  redirect with code     │                         │
  │◀──────────────────────────────────────────────────│
  │                         │  exchange code          │
  │                         │────────────────────────▶│
  │                         │  access + refresh token │
  │                         │◀────────────────────────│
  │  source authorized      │                         │
  │◀────────────────────────│                         │
  │                         │  renews automatically   │
  │                         │────────────────────────▶│


​

Two ways to connect

TikTok can be connected through Medialake's OAuth app or through your own OAuth app:

  1. Medialake's OAuth app (default). Accounts connect using Medialake's central TikTok app. No setup is required: just log in and approve.

  2. Your own OAuth app (optional). If your organization would rather own the app that appears when you authorize, you can create an app on TikTok for Developers and add its credentials to Medialake. Your organization owns the app and can disable it at any time. Setup steps are below.

The permissions requested, and everything else on this page, are identical for both options.


​

Setting up your own OAuth app (optional)

Most organizations connect with Medialake's app and can skip this section. If you do want to use your own app, you'll need a TikTok for Developers account. TikTok has to approve the app's products before it can be used, so allow time for review.

  1. On TikTok for Developers, open Manage apps and create an app for your organization.

  2. Add the Login Kit and Display API products to the app, and request the user.info.basic and video.list scopes. Medialake needs no others.

  3. In the app's Login Kit configuration, register this redirect URI:

https://oauth2.medialakeapp.com/tiktok-redirect
  1. Once TikTok has approved the app, copy its Client key and Client secret.

>Keep the Client secret private. Store it in an approved password manager or secret-management system. Do not email it, paste it into a support ticket, or commit it to source control.


​

Adding the credentials to Medialake

You need Medialake administrator privileges for these steps.

  1. Open Administration → Integrations from the sidebar.

  2. Open the TikTok integration.

  3. In the Access Keys section, click Create New Setting.

  4. In the New access key panel, give the key a Name your team will recognize, such as "Marketing TikTok app".

  5. Under Credentials, enter TikTok's Client key in Tiktok Client ID and the Client secret in Tiktok Client Secret. Both fields accept at least 8 characters made up of letters, numbers, periods, underscores and hyphens, with no spaces. Medialake stores these encrypted and never shows them again.

  6. Under Who can use it?, choose which teams can connect TikTok accounts with this key.

  7. Click Save access key.


​

Verifying it's really us

On TikTok's authorization page, check that the app requesting access is the one you expect: Medialake's TikTok app, or the app your organization created and named. If the name doesn't match, stop and contact us. Never approve a TikTok access request you weren't expecting.


​

Who should do the connecting

The connection is tied to the TikTok account that logs in, and Medialake syncs that account's videos. Please have it done by someone who:

  1. Can log in to the TikTok account you want to sync. One connection covers one TikTok account; to sync several accounts, connect each one separately.

  2. Is a permanent member of your team. If the person who authorized us leaves your company, someone else who can log in to the TikTok account may need to reconnect.

The only account details we read are the account's display name, avatar, and TikTok's account identifiers, to confirm who authorized and to name the source.


​

Limiting what Medialake can access

Medialake can only read the account that authorized it. No other TikTok account's data is reachable with the connection, and Medialake only receives the videos TikTok makes available through its API.


​

Connect and choose what to sync

Anyone on your team who is allowed to connect sources can do this.

  1. Open Connections → Catalogue from the side menu.

  2. Find TikTok and click Connect.

  3. Under How do you want to connect?, choose Connect it myself. If your organization has saved its own TikTok app as an access key, an OAuth app dropdown appears: choose your app, or leave it on Medialake's OAuth app.

  4. Log in to TikTok and approve the request.

  5. Back in Medialake, select the account. It appears as a single entry named after the TikTok account.

Medialake then brings in:

  • Each video as an MP4 file, with its title, description, share link, embed link, duration and creation date. Each video's cover image is brought in too.

  • Each video's availability and visibility. TikTok's API returns your public videos, so a video that's deleted or made private shows as unavailable. See Organic Post Availability and Visibility for how each TikTok privacy setting is recorded.

  • Each video's likes, comments, shares and views. See the Performance Metrics Reference for how organic metrics are captured.

By default Medialake checks for new videos once a day; you can change the schedule under Source Synchronization on the source's General tab.


​

Syncing a date range

To bring in only the videos posted within a period, open the source's Sync Selection tab, click Edit next to the account, and set both Sync Start From and Sync End At. Then click Save. The range only applies when both dates are set.


​

The permissions we request

Permission (scope)

What it lets us do

How we use it

Read the account's basic profile: avatar and display name.

READ ONLY: confirms who authorized and names the source after the account

Read the account's public videos.

READ ONLY: lists your videos, brings them into Medialake, and reads their like, comment, share and view counts

That's the entire list: two read-only scopes. TikTok also offers scopes for publishing and uploading videos. We never request them.


​

What we can't see or do

Regardless of who connects, we cannot:

  • See or store your password, or log in as you

  • Post, edit, or delete videos

  • Comment, like, follow, or send messages on your behalf

  • Change your profile or account settings

  • See ad accounts or advertising data, which come through the separate TikTok Ads integration


​

Staying connected

TikTok access tokens are short-lived, so Medialake renews the connection in the background using the refresh token TikTok issues when you connect. Each renewal returns a new refresh token along with how long it remains valid, and Medialake keeps track of that date. There's nothing to re-approve day to day.

A refresh token does eventually expire (TikTok's token management documentation gives the current lifetimes). Medialake shows a warning on the source 48 hours before it does, so you can re-approve before syncing stops.

The connection stops working if the refresh token expires, access is revoked on TikTok, or a renewal is refused. When that happens, Medialake stops syncing the source and shows a Service Disconnected notice on it. The person who connected it can click Re-Authenticate to log in again, or Check connection if they think it was disconnected by mistake. Other team members see who to contact.


​

Revoking access

You're in control at any time. To remove the connection:

  • In the TikTok app, logged in as the connecting account, open your settings and remove Medialake from the apps that have permission to access your account, or

  • Delete the source in Medialake: open it and, on its General tab, click Delete Service.

Revoking on TikTok's side stops Medialake's access and data collection stops; no action is needed on our side.


​

Troubleshooting

What you see

Likely cause

What to do

Some videos didn't come in

TikTok's API doesn't return every video: see Organic Post Availability and Visibility. A date range on the source also limits what's synced.

Check the video's privacy setting on TikTok and the source's Sync Start From and Sync End At dates.

A video now shows as unavailable

It was deleted on TikTok or made private.

Nothing to fix in Medialake.

Saving the access key fails (your own app only)

A value contains a space or another character the fields don't accept, or is shorter than 8 characters.

Copy the Client key and Client secret again from TikTok for Developers, without surrounding spaces.

TikTok shows an error instead of its authorization page (your own app only)

The redirect URI isn't registered in the app's Login Kit configuration, or the app isn't approved for Login Kit, the Display API, or one of the two scopes.

Correct the app on TikTok for Developers, or connect with Medialake's OAuth app instead.

You're returned to Medialake with an error and no source is created

The login was cancelled, or TikTok refused the code exchange, often because the Client secret in the access key is wrong or has been regenerated.

Try again. If you use your own app, create a new access key with the current Client key and Client secret.

The source shows Service Disconnected

The refresh token expired or access was revoked on TikTok.

Click Re-Authenticate on the source.

If you get stuck, contact [email protected] and we'll walk you through it.


​

Further reading (TikTok documentation)


You can review or withdraw access at any time from your TikTok account settings.

Did this answer your question?