Seperated eventhub service from api service.

wip nbs flow.
Changed uploading a bit.
This commit is contained in:
2020-03-25 21:32:28 +01:00
parent e638370ad4
commit 691be2185e
11 changed files with 151 additions and 81 deletions

View File

@@ -10,12 +10,12 @@ namespace FarmmapsApi.HttpMessageHandlers
{
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
if (!request.Headers.Authorization.Scheme.Equals(OidcConstants.AuthenticationSchemes.AuthorizationHeaderBearer) ||
string.IsNullOrEmpty(request.Headers.Authorization.Parameter))
if (!OidcConstants.AuthenticationSchemes.AuthorizationHeaderBearer.Equals(request.Headers?.Authorization.Scheme) ||
string.IsNullOrEmpty(request.Headers?.Authorization.Parameter))
{
return new HttpResponseMessage(HttpStatusCode.Unauthorized)
{
Content = new StringContent("You must authenticate before using the API")
Content = new StringContent("You must authenticated before using the API")
};
}
return await base.SendAsync(request, cancellationToken);