Skip to content

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Description

Updated the JWT claims documentation in the security and authentication page to clarify the actual requirements for JWT tokens used with Knock's enhanced security mode.

What changed:

  • Modified the JWT claims section to clarify that only sub is required
  • Updated iat and exp claims from "required" to "recommended for security"
  • Added inline comments in the JSON example to distinguish required vs recommended claims

Why this change:
The previous documentation incorrectly stated that all three claims (sub, iat, exp) were required at minimum, when in reality only the sub claim is actually validated as required by the backend. This was causing confusion for developers implementing JWT authentication.

How it was changed:

  • Changed descriptive text from "At a minimum, the JWT to be signed must contain:" to "The JWT must contain the sub claim, and should include iat and exp claims for security:"
  • Updated JSON comments to indicate (required) for sub and (recommended) for iat/exp

Tasks

Addresses feedback from Slack #eng-ai-tasks channel requesting clarification of JWT claims requirements.

Human Review Checklist

  • Verify technical accuracy: Confirm that only sub is actually required by checking backend validation logic
  • Check documentation consistency: Search for other JWT-related documentation that might need similar updates
  • Validate clarity: Ensure the new wording clearly communicates the distinction between required and recommended claims
  • Consider impact: Assess whether existing developer implementations might be affected by this clarification

Note: This change was requested by Scoti Dodson ([email protected]) and implemented by Devin AI in session: https://app.devin.ai/sessions/e16f85da74a34fc6b552e7f55febc50c

Risk Assessment

The main risk is ensuring technical accuracy - this change is based on user feedback rather than direct verification of backend validation code. The change is documentation-only and improves clarity, but reviewers should verify it accurately reflects actual API behavior.

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

vercel bot commented Aug 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Aug 22, 2025 4:00pm

@@ -107,15 +107,15 @@ Knock SDK will look for the key by default.
Within your backend application, you'll need to sign the JWT and make it available to your front-end
client. Usually, you'll do this by passing it down as a serialized property on the user or passing in a cookie.

Your JWT will need to be signed against your **private signing key** using an **RS256** algorithm. At a minimum, the JWT to be signed must contain:
Your JWT will need to be signed against your **private signing key** using an **RS256** algorithm. The JWT must contain the `sub` claim, and should include `iat` and `exp` claims for security:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Your JWT will need to be signed against your **private signing key** using an **RS256** algorithm. The JWT must contain the `sub` claim, and should include `iat` and `exp` claims for security:
Your JWT will need to be signed against your **private signing key** using an **RS256** algorithm. The JWT must contain the `sub` claim and we recommend also including `iat` and `exp` to enforce token expiration.

@scoti-knock scoti-knock merged commit 48dedf4 into main Aug 25, 2025
4 checks passed
@scoti-knock scoti-knock deleted the devin/1755875230-fix-jwt-claims-documentation branch August 25, 2025 20:26
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.

1 participant