astrolabe-web-common

Configure JWT authentication and domain-based SPA routing in ASP.NET Core.

1|5|Updated Aug 6, 2023
One-click install
npx skills add https://github.com/astrolabe-apps/astrolabe-common --skill astrolabe-web-common
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: astrolabe-web-common
Source: https://github.com/astrolabe-apps/astrolabe-common/tree/main/skills/astrolabe-web-common
Command: npx skills add https://github.com/astrolabe-apps/astrolabe-common --skill astrolabe-web-common

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a cohesive set of ASP.NET Core utilities to simplify JWT-based authentication and hosting multiple Single Page Applications (SPAs) within a single application, including domain-based routing and development-mode controller filtering.

Core Features & Use Cases

  • JWT Authentication: Simplifies token creation and validation for ASP.NET Core apps using JwtBearer with a compact configuration workflow.
  • Virtual SPA Hosting: Routes requests to different SPAs based on domain prefixes, path segments, or custom logic, enabling multi-SPA deployments in a single backend.
  • Development-Mode Controllers: Exposes controllers only in development for testing while hiding them in production to improve security.

Quick Start

Install and configure the Astrolabe.Web.Common package in your ASP.NET Core project. Set up JwtBearer authentication using the provided helpers. Enable domain-based SPA routing with UseDomainSpa for each SPA (e.g., main, admin, dashboard) and annotate development-only controllers with [DevMode] as needed.

Frequently Asked Questions about astrolabe-web-common

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

FAQPage Schema
How do I host multiple SPAs on different domains in a single ASP.NET Core app?

Multi-SPA hosting in ASP.NET Core routes requests to different SPAs based on domain prefixes or path segments. Use UseDomainSpa to configure routing for each SPA, enabling multi-SPA deployments in a single backend without external tooling.

What is the best way to configure JWT authentication in an ASP.NET Core backend?

JWT authentication in ASP.NET Core is simplified using lightweight APIs to configure JwtBearer for token creation and validation. This provides a compact configuration workflow without requiring external tooling or complex manual setup.

Can I hide test controllers in production but expose them during ASP.NET Core development?

Development-mode controller visibility in ASP.NET Core exposes controllers only in development for testing while hiding them in production. Annotate development-only controllers with [DevMode] to apply filtering and improve security automatically.

How does domain-based routing work for single page applications in .NET?

Domain-based SPA routing in .NET directs incoming requests to different single page applications using domain prefixes, path segments, or custom logic. This mechanism enables hosting multiple SPAs within one application backend efficiently.

Do I need external packages to set up JwtBearer token validation alongside SPA routing?

No external packages are required to set up JwtBearer token validation and SPA routing. The solution provides lightweight APIs to configure authentication and register SPA routing natively within ASP.NET Core without external dependencies.