Configures CORS for an ABP HTTP API host, including allowed origins, wildcard subdomains, middleware ordering, and tiered/microservice considerations.
Ships in abp-api. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
CORS controls which browser origins (scheme + host + port) are allowed to call your HTTP API from client-side JavaScript. In ABP you configure it on the API host (the HttpApi.Host project), using ASP.NET Core's CORS with one ABP-specific helper (WithAbpExposedHeaders). The allowed origins come from the App:CorsOrigins setting.
This is not the same as OpenIddict redirect URIs, AppUrlOptions, or RedirectAllowedUrls — see When Not to Use.
UseCors into the pipeline in the right order.AppUrlOptions named app URLs and RedirectAllowedUrls (server-side redirect allow-list) — use the configure-app-urls skill.App:CorsOriginsThe startup templates read allowed origins from the App:CorsOrigins setting — a comma-separated list of origins (no trailing path), in appsettings.json:
{
"App": {
"CorsOrigins": "https://*.example.com,http://localhost:4200,https://localhost:44307"
}
}
http://localhost:4200 and https://localhost:4200 are different origins; so are different ports.*. in the host (e.g. https://*.example.com) marks a wildcard subdomain (see step 2)., (removing empty entries) and trims a trailing / from each entry (RemovePostFix("/")), because a trailing slash makes the origin string not match the browser's Origin header.The template's ConfigureCors builds a default policy from App:CorsOrigins:
context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
configuration["App:CorsOrigins"]?
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.RemovePostFix("/"))
.ToArray() ?? Array.Empty<string>())
.WithAbpExposedHeaders() // ABP: exposes ABP's response headers to the browser
.SetIsOriginAllowedToAllowWildcardSubdomains() // makes https://*.example.com match subdomains
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials(); // only if the browser sends credentials (cookies, HTTP auth, client certs, or fetch credentials: 'include')
});
});
WithAbpExposedHeaders() is the only ABP-specific call — it adds ABP's framework response headers, the error-format header (_AbpErrorFormat) and the tenant-resolution-error header (Abp-Tenant-Resolve-Error), to Access-Control-Expose-Headers so browser code can read them. Everything else is plain ASP.NET Core CORS.SetIsOriginAllowedToAllowWildcardSubdomains() is what makes a https://*.example.com entry actually match https://tenant1.example.com. Without it, the wildcard entry never matches.UseCorsAdd app.UseCors() in OnApplicationInitialization, after UseRouting() and before UseAuthentication()/UseAuthorization(). If it runs too late (after auth) or before routing, preflight requests don't get the CORS headers and the browser blocks the call. The startup template already places it correctly.
AllowCredentials() is needed only when the browser sends credentials — cookies, HTTP authentication, client certificates, or fetch(..., { credentials: 'include' }) (an explicit Authorization header alone doesn't require it; that's just an allowed request header). It cannot be combined with a wildcard * origin — the browser rejects Access-Control-Allow-Origin: * together with credentials. That's why the template lists explicit origins (and uses wildcard subdomains of a named domain, not *). If you don't need credentials, you can loosen origins; if you do, enumerate the exact origins.
CORS must be configured on whatever the browser talks to directly:
HttpApi.Host (and the AuthServer if the SPA hits it directly for the OAuth flow).OPTIONS request to your API with Origin: <spa-origin> and Access-Control-Request-Method: POST should return 204 with Access-Control-Allow-Origin: <spa-origin> (and Access-Control-Allow-Credentials: true when credentials are on). Check the actual response headers, not just appsettings.json.https://example.com/) — it won't match the browser Origin header; drop it (the template's RemovePostFix("/") does this for App:CorsOrigins).SetIsOriginAllowedToAllowWildcardSubdomains() — https://*.example.com silently never matches.AllowCredentials() with a * origin — rejected by the browser; enumerate origins or a named wildcard-subdomain domain.UseCors order — must be after UseRouting, before UseAuthentication.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cors, abp, cross-origin, api-configuration, security-configuration
6 skills in this plugin
/configure-swagger-openapiWire up Swagger/OpenAPI for an ABP host with the Volo.Abp.Swashbuckle helpers, including OAuth/OIDC authorize flows and hiding framework endpoints. USE FOR: AddAbpSwaggerGen + UseAbpSwaggerUI setup, AddAbpSwaggerGenWithOAuth / AddAbpSwaggerGenWithOidc for interactive auth on the Swagger UI, AbpSwaggerOidcFlows, HideAbpEndpoints, a metadata/discovery address that differs from the issuer (k8s/docker), versioned SwaggerDoc definitions. DO NOT USE FOR: exposing application services as HTTP controllers (use expose-http-apis); generating C# client proxies for remote APIs (use consume-remote-services); choosing an API versioning strategy (use version-http-apis); configuring the OpenIddict token/authorization server or JWT validation itself (use configure-openiddict-authentication / configure-openiddict-validation).
/consume-remote-servicesCall a remote ABP HTTP API from C# through generated client proxies instead of raw HttpClient. USE FOR: setting up dynamic (runtime) or static (build-time) client proxies, configuring AbpRemoteServiceOptions (BaseUrl / named endpoints), wiring tiered / microservice calls, authenticating proxy calls (forward the current user token with AbpHttpClientIdentityModelWebModule, or client credentials with AbpHttpClientIdentityModelModule + IdentityClients), adding Polly retry to proxy clients. DO NOT USE FOR: exposing your own services as HTTP APIs or auto controllers (use expose-http-apis); choosing sync HTTP vs async events between services or the outbox/inbox (use design-module-and-service-communication); routing proxies through Dapr service invocation (use integrate-dapr-services).
/expose-http-apisExpose ABP application services as REST endpoints through Auto/Conventional API Controllers. USE FOR: publishing application services as HTTP controllers, route/verb conventions, [RemoteService] toggles, integration services and [IntegrationService]. DO NOT USE FOR: calling a remote ABP HTTP API from C# with client proxies (use consume-remote-services); designing sync-vs-async inter-service communication or the outbox/inbox (use design-module-and-service-communication); building UI pages (use angular-ui / blazor-ui / mvc-razor-ui).
/use-abp-standard-endpointsUse ABP's built-in application-configuration and application-localization HTTP endpoints, and extend them with an IApplicationConfigurationContributor. USE FOR: reading /api/abp/application-configuration (current user, granted policies, settings, features, multi-tenancy, timing) and /api/abp/application-localization from a custom client; extending the config with IApplicationConfigurationContributor and AbpApplicationConfigurationOptions. DO NOT USE FOR: publishing your own application services as controllers (use expose-http-apis); calling remote ABP APIs with C# client proxies (use consume-remote-services); consuming the config in Angular/Blazor/MVC startup (use the per-stack UI skill: angular-ui / blazor-ui / mvc-razor-ui); defining settings/features themselves (use manage-settings-and-features); defining permissions (use permissions-and-authorization).
/version-http-apisAdd API versioning to ABP HTTP APIs so multiple versions of the same service coexist behind static client proxies. USE FOR: AddAbpApiVersioning, query/header/media-type version readers, attaching ApiVersions to conventional controllers, ICurrentApiVersionInfo runtime version switching, the versioned API explorer. DO NOT USE FOR: exposing services as controllers in the first place (use expose-http-apis); Swagger UI / OpenAPI doc setup (use configure-swagger-openapi); generating or calling C# client proxies (use consume-remote-services).
/abp-api:configure-corsfrom abp-api
npx claudepluginhub abpframework/abp-skills --plugin abp-apiOther plugins' skills for the same job