Redundant Client ID for TikTok Oauth #1651

Closed
opened 2026-03-13 08:53:39 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @szcharlesji on GitHub (Aug 6, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Client ID is not used in TikTok Oauth but it is required:

  socialProviders: {
    tiktok: {
      clientId: process.env.TIKTOK_CLIENT_ID!,
      clientKey: process.env.TIKTOK_CLIENT_KEY!,
      clientSecret: process.env.TIKTOK_CLIENT_SECRET!,
    },
  },

Current vs. Expected behavior

It is just unnecessary

What version of Better Auth are you using?

1.3.4

Provide environment information

NA

Which area(s) are affected? (Select all that apply)

Types

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  socialProviders: {
    tiktok: {
      clientId: process.env.TIKTOK_CLIENT_ID!,
      clientKey: process.env.TIKTOK_CLIENT_KEY!,
      clientSecret: process.env.TIKTOK_CLIENT_SECRET!,
    },
  },
});

Additional context

No response

Originally created by @szcharlesji on GitHub (Aug 6, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Client ID is not used in TikTok Oauth but it is required: ``` typescript socialProviders: { tiktok: { clientId: process.env.TIKTOK_CLIENT_ID!, clientKey: process.env.TIKTOK_CLIENT_KEY!, clientSecret: process.env.TIKTOK_CLIENT_SECRET!, }, }, ``` ### Current vs. Expected behavior It is just unnecessary ### What version of Better Auth are you using? 1.3.4 ### Provide environment information ```bash NA ``` ### Which area(s) are affected? (Select all that apply) Types ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ socialProviders: { tiktok: { clientId: process.env.TIKTOK_CLIENT_ID!, clientKey: process.env.TIKTOK_CLIENT_KEY!, clientSecret: process.env.TIKTOK_CLIENT_SECRET!, }, }, }); ``` ### Additional context _No response_
GiteaMirror added the social-provider label 2026-03-13 08:53:39 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 6, 2025):

You're right—TikTok OAuth in Better Auth doesn't use clientId in the authorization URL, but the type definitions still require it in your config. This is a known issue and is likely due to a shared type structure across social providers, not an actual implementation need for TikTok. The maintainers have acknowledged similar problems for other providers and suggested making these fields optional in the future (discussion). For now, you have to provide a value for clientId (even a dummy one) to satisfy the type checker. If you want to see exactly how TikTok OAuth is implemented, you can check the provider code, which confirms clientId isn't used in the authorization URL but is referenced in token refresh logic (source).

Recent updates to the generic OAuth implementation may allow more flexible configuration in the future (PR #3410), but as of v1.3.4, the type requirement remains.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 6, 2025): <!-- Answer --> You're right—TikTok OAuth in Better Auth doesn't use clientId in the authorization URL, but the type definitions still require it in your config. This is a known issue and is likely due to a shared type structure across social providers, not an actual implementation need for TikTok. The maintainers have acknowledged similar problems for other providers and suggested making these fields optional in the future ([discussion](https://github.com/better-auth/better-auth/issues/1567)). For now, you have to provide a value for clientId (even a dummy one) to satisfy the type checker. If you want to see exactly how TikTok OAuth is implemented, you can check the provider code, which confirms clientId isn't used in the authorization URL but is referenced in token refresh logic ([source](https://github.com/better-auth/better-auth/blob/69d5239e8f759966e84309743e5c3a5d41bce4b2/packages/better-auth/src/social-providers/tiktok.ts)). Recent updates to the generic OAuth implementation may allow more flexible configuration in the future ([PR #3410](https://github.com/better-auth/better-auth/pull/3410)), but as of v1.3.4, the type requirement remains. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/0ca8ace2-d40c-47c9-8296-e09339dd2885?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0ca8ace2-d40c-47c9-8296-e09339dd2885?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0ca8ace2-d40c-47c9-8296-e09339dd2885?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0ca8ace2-d40c-47c9-8296-e09339dd2885?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0ca8ace2-d40c-47c9-8296-e09339dd2885?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0ca8ace2-d40c-47c9-8296-e09339dd2885?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0ca8ace2-d40c-47c9-8296-e09339dd2885?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/3828)
Author
Owner

@himself65 commented on GitHub (Aug 7, 2025):

Thanks for the feedback, I can see it is unnecessary. I will give a fix

Image
@himself65 commented on GitHub (Aug 7, 2025): Thanks for the feedback, I can see it is unnecessary. I will give a fix <img width="1017" height="589" alt="Image" src="https://github.com/user-attachments/assets/49311364-56b5-4e21-88d8-e0d64f08c369" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1651