authentication-dotnet-api-key

Implement custom API Key authentication for ASP.NET Core backends.

12|2|Updated May 4, 2020
One-click install
npx skills add https://github.com/hoangnh2412/jarvis --skill authentication-dotnet-api-key
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication-dotnet-api-key
Source: https://github.com/hoangnh2412/jarvis/tree/main/.opencode/skills/authentication-dotnet/providers/api-key
Command: npx skills add https://github.com/hoangnh2412/jarvis --skill authentication-dotnet-api-key

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the manual overhead of building custom API Key authentication for Jarvis ASP.NET Core backends, eliminating repetitive boilerplate code and reducing configuration errors.

Core Features & Use Cases

  • Custom Provider Integration: Seamlessly register Jarvis's CoreApiKey authentication with your own IApiKeyProvider implementation for tailored key validation and client mapping.
  • Flexible Header Configuration: Support for default X-API-KEY headers or custom header names configured directly in appsettings.json.
  • Standardized Error Handling: Automatically returns 401 Unauthorized responses for missing or invalid API keys, with 200 OK responses for requests to protected endpoints with valid keys.
  • Use Case: For example, if you are building a public API for third-party service integrations, use this Skill to quickly deploy secure API Key authentication without writing custom middleware from scratch.

Quick Start

Use the authentication-dotnet-api-key skill to configure API Key authentication for your Jarvis backend that validates requests via a custom HTTP header and maps valid keys to client IDs.

Frequently Asked Questions about authentication-dotnet-api-key

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

FAQPage Schema
How do I implement custom API Key authentication in an ASP.NET Core backend?

To implement API Key authentication in an ASP.NET Core backend, integrate the Jarvis.Authentications.ApiKey package and register a custom IApiKeyProvider to validate static keys sent via configurable HTTP headers.

How do I configure API Key validation to use a custom HTTP header in .NET?

Configure API Key validation for a custom HTTP header by defining the header name directly in appsettings.json, allowing the ASP.NET Core middleware to extract and verify the static key against your custom IApiKeyProvider logic.

How does API Key authentication handle unauthorized requests in ASP.NET Core?

API Key authentication handles unauthorized requests by automatically returning 401 Unauthorized responses for missing or invalid keys, while granting 200 OK responses to protected endpoints when valid keys are verified.

Can I use custom API Key validation logic for third-party client integrations?

Yes, you can use custom API Key validation logic for third-party integrations by implementing the IApiKeyProvider interface to enforce tailored key verification and map valid keys to specific client IDs.

What is the best way to enforce access control on protected API endpoints without writing custom middleware?

The best way to enforce access control without writing custom middleware is using a dedicated API Key authentication package that handles boilerplate validation and standard 401 error responses for protected ASP.NET Core endpoints.