Skip to content

Conversation

ByeongUkChoi
Copy link
Contributor

✨ Summary

Remove jti claim from tokens generated by Kotlin Server SDK to
align with LiveKit CLI and other Server SDKs.

🗒️ Motivation

  • Other official SDKs (JS, Go, Python) and lk token create omit jti.
  • LiveKit server does not use jti; adding it creates inconsistent
    tokens and duplicates sub.
  • Simplifies debugging when comparing tokens across languages.

🔧 Changes

  • AccessToken.kt
    • delete withJWTId(id) call in toJwt().

🧪 Testing

  • Added unit test ensuring decoded payload excludes jti.
  • Verified room join using dev server with new token.
  • Compared output to CLI token – headers/payload now match.

🧩 Compatibility

No breaking change. Existing tokens stay valid; new tokens are a subset
of old ones, so server acceptance is unaffected.

📚 References

  • LiveKit Auth docs: token example w/o jti.
  • Node Server SDK AccessToken.ts implementation.
  • Go & Python Server SDK read-me token snippets.

The Kotlin server SDK was the only official SDK that included a `jti`
claim (set to `identity`) in generated JWTs. Other SDKs and the CLI omit
this field, and the LiveKit server does not rely on it. Removing
`withJWTId` brings parity across languages and avoids confusion when
debugging tokens.
Copy link

changeset-bot bot commented Jun 19, 2025

🦋 Changeset detected

Latest commit: 74162f2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
server-sdk-kotlin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Jun 19, 2025

CLA assistant check
All committers have signed the CLA.

@davidzhao davidzhao requested a review from davidliu June 19, 2025 07:09
Copy link
Contributor

@davidliu davidliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidliu davidliu merged commit ff97515 into livekit:main Jun 19, 2025
2 checks passed
@davidliu davidliu mentioned this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants