Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor JWT Feature #3290

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Minor JWT Feature #3290

wants to merge 4 commits into from

Conversation

pablodanswer
Copy link
Contributor

@pablodanswer pablodanswer commented Nov 29, 2024

JWT Authentication Guide

Setup

  1. Set environment variable on your server:
export JWT_PUBLIC_KEY_URL=http://localhost:8000/public-key.pem

Authentication Flow

  1. Get JWT Token
POST https://auth.yourservice.com/login
{
  "email": "[email protected]",
  "password": "yourpassword"
}
  1. Use Token in API Requests
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
     https://api.yourservice.com/protected-endpoint

Key Points

  • Server verifies tokens using public key from JWT_PUBLIC_KEY_URL
  • Token must include email claim in payload
  • Include token in Authorization: Bearer YOUR_JWT_TOKEN header
  • Server caches public key for performance

Copy link

vercel bot commented Nov 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2024 9:27pm

@pablodanswer pablodanswer changed the title first pass Minor JWT Feature Nov 30, 2024
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