I use tokens generated by an authentication service for my app. No problems there. Now I have introduced Swashbuckle to document my API an I can authenticate as follows by s
In the end I moved to NSwag so I am not sure what the original issue was. The solution in Nswag is as follows;
services.AddSwaggerDocument(document =>
{
document.DocumentName = "CPSwagger";
document.Title = "My Mobile API";
document.Version = "v10.3.4";
document.Description = "An interface for some software.";
document.DocumentProcessors.Add(
new SecurityDefinitionAppender("JWT token", new NSwag.OpenApiSecurityScheme
{
Type = NSwag.OpenApiSecuritySchemeType.ApiKey,
Name = "Authorization",
Description = "Copy 'Bearer ' + valid JWT token into field",
In = NSwag.OpenApiSecurityApiKeyLocation.Header
}));
document.OperationProcessors.Add(new OperationSecurityScopeProcessor("JWT token"));
});