Skip to content

Commit

Permalink
Add missing platform subscription key to Eformidling complete request…
Browse files Browse the repository at this point in the history
… against storage.
  • Loading branch information
Ronny Birkeli committed Nov 7, 2022
1 parent 64b0690 commit 1aa49b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Altinn.App.Api/Controllers/EventsReceiverController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task<ActionResult> Post([FromQuery] string code, [FromBody] CloudEv
}
catch (Exception ex)
{
_logger.LogError("Unable to process event {eventType}. An exception was raised while checking for delivery status of message {messageid}. Exception throw {exceptionMessage}", cloudEvent.Type, cloudEvent.Id, ex.Message);
_logger.LogError("Unable to process event {eventType}. An exception was raised while processing message {messageid}. Exception thrown {exceptionMessage}", cloudEvent.Type, cloudEvent.Id, ex.Message);
return new StatusCodeResult(500);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Altinn.ApiClients.Maskinporten.Interfaces;
using Altinn.ApiClients.Maskinporten.Models;
using Altinn.App.Core.Configuration;
using Altinn.App.Core.Constants;
using Altinn.App.Core.Extensions;
using Altinn.App.Core.Features;
using Altinn.App.Core.Helpers;
Expand All @@ -15,6 +16,7 @@
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System.Net;
using System.Net.Http.Headers;
using System.Security.Cryptography.X509Certificates;

namespace Altinn.App.Core.EFormidling.Implementation
Expand Down Expand Up @@ -114,6 +116,8 @@ private async Task<Instance> AddCompleteConfirmation(int instanceOwnerPartyId, G
TokenResponse altinnToken = await GetOrganizationToken();

_httpClient.BaseAddress = new Uri(_platformSettings.ApiStorageEndpoint);
_httpClient.DefaultRequestHeaders.Add(General.SubscriptionKeyHeaderName, _platformSettings.SubscriptionKey);
_httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await _httpClient.PostAsync(altinnToken.AccessToken, apiUrl, new StringContent(string.Empty));

if (response.StatusCode == HttpStatusCode.OK)
Expand Down

0 comments on commit 1aa49b6

Please sign in to comment.