Enigmatry.Entry.Swagger
10.4.0
See the version list below for details.
dotnet add package Enigmatry.Entry.Swagger --version 10.4.0
NuGet\Install-Package Enigmatry.Entry.Swagger -Version 10.4.0
<PackageReference Include="Enigmatry.Entry.Swagger" Version="10.4.0" />
<PackageVersion Include="Enigmatry.Entry.Swagger" Version="10.4.0" />
<PackageReference Include="Enigmatry.Entry.Swagger" />
paket add Enigmatry.Entry.Swagger --version 10.4.0
#r "nuget: Enigmatry.Entry.Swagger, 10.4.0"
#:package Enigmatry.Entry.Swagger@10.4.0
#addin nuget:?package=Enigmatry.Entry.Swagger&version=10.4.0
#tool nuget:?package=Enigmatry.Entry.Swagger&version=10.4.0
Swagger Security
This library provides security enhancements for Swagger/OpenAPI documentation in ASP.NET Core applications.
Intended Usage
Use this library to add security features to your Swagger documentation, such as authentication requirements, API key configuration, and endpoint access control.
Installation
Add the package to your project:
dotnet add package Enigmatry.Entry.Swagger
Usage Example
using Enigmatry.Entry.Swagger;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using NSwag.Generation.AspNetCore;
using System.Collections.Generic;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// Add Swagger with OAuth 2.0 Authorization Code flow
services.AddEntrySwaggerWithAuthorizationCode(
appTitle: "My API",
authorizationUrl: "https://auth.example.com/authorize",
tokenUrl: "https://auth.example.com/token",
scopes: new Dictionary<string, string>
{
{ "api", "API access" },
{ "openid", "OpenID" },
{ "profile", "Profile information" }
},
appVersion: "v1",
configureSettings: settings =>
{
// Configure additional Swagger document settings
settings.Description = "API with OAuth2 security";
// You can add custom schema processors if needed
settings.SchemaSettings.SchemaNameGenerator = new CustomSwaggerSchemaNameGenerator();
});
}
public void Configure(IApplicationBuilder app)
{
// Enable Swagger UI with OAuth2 client integration
app.UseEntrySwaggerWithOAuth2Client(
clientId: "swagger-ui-client",
clientSecret: "", // Optional client secret
path: "/api-docs"
);
}
}
Breaking change: Implicit Grant flow removed
AddEntrySwaggerWithImplicitGrant and the legacy AppAddSwaggerWithImplicitGrant have been removed.
The OAuth2 Implicit Grant flow is deprecated and removed in OAuth 2.1:
access tokens are returned in the browser URL fragment (leakable via referrer headers, browser history and server logs)
and no refresh tokens are issued.
Replace the call with the Authorization Code + PKCE equivalent; the parameters are identical:
// Before
services.AddEntrySwaggerWithImplicitGrant(appTitle, authorizationUrl, tokenUrl, scopes, appVersion, configureSettings);
// After
services.AddEntrySwaggerWithAuthorizationCode(appTitle, authorizationUrl, tokenUrl, scopes, appVersion, configureSettings);
and wire the Swagger UI with app.UseEntrySwaggerWithOAuth2Client(clientId, clientSecret, path), which enables PKCE
for the Authorization Code grant. Your identity provider must allow the Authorization Code flow (with PKCE, no client
secret) for the Swagger UI client.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- JetBrains.Annotations (>= 2026.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Newtonsoft.Json (>= 13.0.4)
- NJsonSchema (>= 11.6.1)
- NSwag.AspNetCore (>= 14.7.1)
- NSwag.Generation.AspNetCore (>= 14.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.5.0 | 0 | 10/15/2026 |
| 10.4.0 | 107 | 10/6/2026 |
| 10.3.1 | 1,557 | 8/20/2026 |
| 10.3.0 | 2,874 | 7/21/2026 |
| 10.2.4 | 1,151 | 7/3/2026 |
| 10.2.3 | 1,137 | 6/1/2026 |
| 10.2.3-preview.4 | 98 | 6/1/2026 |
| 10.2.2 | 602 | 4/27/2026 |
| 10.2.1-preview.1 | 89 | 4/27/2026 |
| 10.1.0 | 442 | 4/16/2026 |
| 10.0.1 | 299 | 5/19/2026 |
| 10.0.1-preview.2 | 86 | 4/16/2026 |
| 10.0.0 | 155 | 4/2/2026 |
| 9.6.0 | 604 | 3/18/2026 |
| 9.5.0 | 1,675 | 1/26/2026 |
| 9.4.0 | 2,378 | 12/22/2025 |
| 9.3.1-preview.3 | 310 | 12/18/2025 |
| 9.3.1-preview.1 | 535 | 11/25/2025 |
| 8.3.1-preview.1 | 198 | 12/24/2025 |
| 8.3.0 | 2,099 | 12/23/2025 |