Verify a token in your backend
Verify the session token before you trust anything in it.
- Node
- Python
- Go
import { verifyToken } from "@keyward/backend";
const claims = await verifyToken(token, { jwtKey: process.env.KEYWARD_JWT_KEY });from keyward import verify_token
claims = verify_token(token, jwt_key=os.environ["KEYWARD_JWT_KEY"])claims, err := keyward.VerifyToken(ctx, token, keyward.WithJWTKey(os.Getenv("KEYWARD_JWT_KEY")))Do not decode the token without verifying it. A decoded but unverified token can be forged by anyone.
Updated
Was this page helpful?