auth-jwt-session

Implement JWT issuance, verification, and OAuth2/OIDC authentication workflows.

9|3|Updated Jun 13, 2026
One-click install
npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill auth-jwt-session
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-jwt-session
Source: https://github.com/Sir-chawakorn/sanook-cli/tree/main/skills/auth-jwt-session
Command: npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill auth-jwt-session

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity and security risks inherent in building custom authentication systems, ensuring that session management, token handling, and authorization checks are implemented according to industry best practices.

Core Features & Use Cases

  • JWT Lifecycle Management: Handles issuance, verification, and refresh rotation for stateless authentication.
  • Security Hardening: Provides guidance on cookie flags, algorithm locking, and preventing common vulnerabilities like algorithm confusion or token reuse.
  • Use Case: When building a new API, use this skill to configure secure OAuth2/OIDC flows and implement robust RBAC middleware that denies access by default.

Quick Start

Use the auth-jwt-session skill to audit my current JWT implementation for potential security flaws and suggest a secure refresh token rotation strategy.

Frequently Asked Questions about auth-jwt-session

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement secure JWT authentication and session management for my backend API?

Secure JWT authentication involves issuing cryptographically signed tokens, validating signatures with algorithm locking, and managing session persistence with secure cookie flags. This ensures stateless user login while preventing common token-based attack vectors.

What is the best way to prevent JWT algorithm confusion and token reuse vulnerabilities?

Preventing JWT vulnerabilities requires algorithm locking during signature validation and implementing secure refresh token rotation strategies. Auditing token handling ensures that session management workflows reject reused tokens and deny access by default.

How do I set up OAuth2 and OIDC integration for user login?

OAuth2 and OIDC integration for user login requires configuring secure authorization flows and validating identity tokens. Implementing robust RBAC middleware alongside these flows ensures that role-based access control denies access by default for unauthorized scopes.

Does this approach support role-based access control middleware for stateless authentication?

Role-based access control is fully supported for stateless authentication by validating JWT claims within middleware. This RBAC middleware evaluates user permissions extracted from tokens, ensuring that backend API endpoints deny access by default unless explicitly authorized.

Why does my refresh token rotation strategy keep failing during session persistence?

Refresh token rotation fails when token reuse detection mechanisms are not enforced or secure cookie configuration is missing. A robust session management workflow must invalidate old tokens immediately upon issuing new JWTs to prevent replay attacks.

When do I need cryptographic signature validation for token-based authentication?

Cryptographic signature validation is needed whenever implementing token-based authentication to ensure JWT integrity. Validating signatures prevents tampering and is a strict requirement for securing backend development tasks involving stateless session persistence and user login.