How to Authorize once in Swagger UI in case of multiple swagger definitions

Viewed 394

I need to Authorize in the Swagger UI once by hitting Authorize Button. Is it possible to switch between different swagger endpoints and have token pre-set on all of them? Now it doesn't understand I already authenticated or loses received token on different Swagger endpoint / definition.

I configure SecurityDefinitions/SecurityRequirements once via AddSwaggerGen method. Then I add multiple endpoints in UseSwaggerUI:

app.UseSwaggerUI(c =>
{
  groupNames.ForEach(groupName => c.SwaggerEndpoint(
    $"/swagger/{groupName}/swagger.json", $"API Name - {groupName}"));
});
0 Answers
Related