From c8d45a01c961f5b8fa5c0827dd57208ab8e9ef81 Mon Sep 17 00:00:00 2001 From: littlefoot Date: Wed, 13 Oct 2021 22:54:02 -0400 Subject: [PATCH] swashbuckle fix --- WebAPI/Controllers/BaseController.cs | 2 +- WebAPI/Startup.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebAPI/Controllers/BaseController.cs b/WebAPI/Controllers/BaseController.cs index 0816f16..cdefec4 100644 --- a/WebAPI/Controllers/BaseController.cs +++ b/WebAPI/Controllers/BaseController.cs @@ -10,7 +10,7 @@ namespace WebAPI.Controllers protected string BearerToken => Request.Headers.Keys.Contains(HeaderNames.Authorization) && Request.Headers[HeaderNames.Authorization].Count > 0 - ? Request.Headers[HeaderNames.Authorization].First() + ? Request.Headers[HeaderNames.Authorization].First().Split(" ")[1] : String.Empty; } } \ No newline at end of file diff --git a/WebAPI/Startup.cs b/WebAPI/Startup.cs index a685ba8..28bf8ed 100644 --- a/WebAPI/Startup.cs +++ b/WebAPI/Startup.cs @@ -38,7 +38,7 @@ namespace WebAPI Description = "JWT Token", Name = "Authorization", In = ParameterLocation.Header, - Type = SecuritySchemeType.ApiKey, + Type = SecuritySchemeType.Http, Scheme = "Bearer" }); c.AddSecurityRequirement(new OpenApiSecurityRequirement()