A package to simplify adding authentication to the Swagger.
Auth0
builder.Services.AddSwaggerGen(c =>
{
c.AddAuth0(authority, audience);
});
app.UseSwaggerUI(c =>
{
c.UseAuth0(clientId, scopes);
});
Identity Server
builder.Services.AddSwaggerGen(c =>
{
c.AddIdentityServer(authority);
});
app.UseSwaggerUI(c =>
{
c.UseIdentityServer(clientId, scopes);
});
OAuth2
builder.Services.AddSwaggerGen(c =>
{
c.AddOAuth2(authorizationUrl, tokenUrl);
});
app.UseSwaggerUI(c =>
{
c.UseOAuth2(clientId, scopes);
});
Install the required .NET SDK.
Run:
$ dotnet build