Decode and work with JWT (JSON Web Token) in SQL queries
Maintainer(s):
GalvinGao
Installing and Loading
INSTALL jwt FROM community;
LOAD jwt;
About jwt
The JWT extension provides functionality to decode and work with JWT (JSON Web Token) directly in DuckDB SQL queries.
Features
jwt_decode_payload(token)
: Decodes the payload part of a JWT token and returns it as a JSON string- Base64 URL-safe decoding for JWT token components
Use Cases
- Analyzing JWT tokens in your data
- Extracting claims from authentication tokens
- Debugging JWT-based authentication systems
- Working with JWT tokens in data pipelines
You can combine the JWT functions with DuckDB's built-in JSON functionality to extract specific claims from tokens.
Added Functions
function_name | function_type | description | comment | examples |
---|---|---|---|---|
jwt_decode_payload | scalar | NULL | NULL |