authentication-skill

Implement JWT, OAuth2, sessions, MFA, and RBAC authentication systems.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/HotspotVPN/Nest_Match_UAE --skill authentication-skill-hotspotvpn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication-skill
Source: https://github.com/HotspotVPN/Nest_Match_UAE/tree/main/skills/authentication-skill
Command: npx skills add https://github.com/HotspotVPN/Nest_Match_UAE --skill authentication-skill-hotspotvpn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authentication and authorization are foundational for protecting user data and resources in modern apps; this skill provides a structured approach to implementing JWT, OAuth2, sessions, MFA, social login, and RBAC to secure sign-in and access across services.

Core Features & Use Cases

  • JWT for stateless API authentication and ID tokens; supports short-lived access tokens and refresh tokens with rotation.
  • Session-based Web authentication for traditional server-rendered apps with server-side state management.
  • OAuth2 / Social Login to enable sign-in with Google, GitHub, and other providers.
  • MFA and Passkeys support options to strengthen login security.
  • RBAC and permission checks to enforce fine-grained access control across resources.
  • Token rotation, httpOnly refresh cookies, and middleware for requireAuth and requirePermission.
  • Guidance on choosing managed providers (Clerk, Supabase Auth, Auth0, NextAuth) and when to self-host.

Quick Start

Configure a secure authentication flow by selecting JWT and session strategies, then implement login, refresh, and RBAC middleware.

Frequently Asked Questions about authentication-skill

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

FAQPage Schema
How do I implement JWT authentication with refresh token rotation for my API?

JWT authentication uses short-lived access tokens paired with refresh token rotation to secure APIs. This approach maintains stateless API authentication while allowing token renewal via httpOnly refresh cookies without requiring repeated logins.

What's the best way to add OAuth2 social login to a web application?

OAuth2 social login enables users to sign in with providers like Google and GitHub. Implementing OAuth2 involves configuring multi-provider sign-ins to handle token exchanges and user provisioning across your web app.

Can I use both session-based auth and JWT in the same application?

Both session-based auth and JWT can coexist in one application. Use session management for traditional server-rendered pages with server-side state, while applying JWT for stateless API authentication across your services.

How does role-based access control work for securing API endpoints?

Role-based access control (RBAC) enforces fine-grained permission checks via middleware. Applying requireAuth and requirePermission middleware to API endpoints ensures only users with specific roles can access protected resources.

Do I need a managed authentication provider or should I self-host?

Choosing a managed authentication provider like Clerk, Supabase Auth, Auth0, or NextAuth reduces development overhead and provides built-in security. Self-hosting offers more control but requires maintaining token handling, MFA, and OAuth flows yourself.

How do I set up MFA and passkeys to strengthen login security?

MFA and passkeys strengthen login security by requiring additional verification factors beyond passwords. Setting up MFA involves configuring multi-step verification flows during login and signup to protect user accounts from unauthorized access.