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()