api-authentication

Provide code examples for OAuth 2.0, JWT, and API key authentication.

19|5|Updated Nov 23, 2025
One-click install
npx skills add https://github.com/Nir-Bhay/markups --skill api-authentication-nir-bhay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-authentication
Source: https://github.com/Nir-Bhay/markups/tree/main/.agents/skills/api-authentication
Command: npx skills add https://github.com/Nir-Bhay/markups --skill api-authentication-nir-bhay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and code examples for implementing robust API authentication and authorization mechanisms, ensuring the security and integrity of your applications.

Core Features & Use Cases

  • Authentication Protocols: Covers API Keys, JWT, and OAuth 2.0 flows.
  • Security Best Practices: Details secure token storage, rate limiting, and MFA implementation.
  • Use Case: Secure a RESTful API by implementing JWT-based authentication with middleware in Express.js and providing refresh token strategies.

Quick Start

Implement JWT authentication for an Express.js API using the provided TypeScript middleware example.

Frequently Asked Questions about api-authentication

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

FAQPage Schema
How do I implement JWT authentication for a RESTful API?

You can secure a RESTful API by implementing JWT-based authentication using TypeScript middleware in Express.js. This approach provides robust token validation and includes strategies for issuing refresh tokens.

What is the best way to securely store API tokens?

Secure token storage is a critical best practice for API authentication, preventing unauthorized access to sensitive credentials. Proper implementation ensures tokens remain protected during transmission and while at rest.

Does OAuth 2.0 work with JWT for API security?

Yes, OAuth 2.0 flows are commonly used alongside JWT for comprehensive API security. OAuth 2.0 handles the authorization process, while JWT provides a compact, self-contained way to securely transmit information between parties.

How do I add multi-factor authentication to an API?

Multi-factor authentication can be added to an API by implementing an additional verification step during the login process. This security measure requires users to provide two or more verification factors to gain access.

When should I use API keys instead of OAuth 2.0?

API keys are typically used for simpler machine-to-machine authentication, whereas OAuth 2.0 is better suited for delegated access and complex user authorization flows. The choice depends on your specific security requirements and use case.