diff --git a/src/Altinn.Correspondence.API/appsettings.json b/src/Altinn.Correspondence.API/appsettings.json index 10f68b8c..46bdb452 100644 --- a/src/Altinn.Correspondence.API/appsettings.json +++ b/src/Altinn.Correspondence.API/appsettings.json @@ -2,7 +2,8 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Warning" } }, "AllowedHosts": "*" diff --git a/src/Altinn.Correspondence.Integrations/Altinn/Authorization/AltinnTokenXacmlMapper..cs b/src/Altinn.Correspondence.Integrations/Altinn/Authorization/AltinnTokenXacmlMapper..cs index 11d81ef3..735a9066 100644 --- a/src/Altinn.Correspondence.Integrations/Altinn/Authorization/AltinnTokenXacmlMapper..cs +++ b/src/Altinn.Correspondence.Integrations/Altinn/Authorization/AltinnTokenXacmlMapper..cs @@ -50,17 +50,17 @@ private static XacmlJsonCategory CreateResourceCategory(string resourceId, Claim resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(AltinnXacmlUrns.ResourceId, resourceId, DefaultType, DefaultIssuer)); - if (party.IsOrganizationNumber()) + if (party.WithoutPrefix().IsOrganizationNumber()) { - resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.OrganizationNumberAttribute, party, DefaultType, DefaultIssuer)); + resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.OrganizationNumberAttribute, party.WithoutPrefix(), DefaultType, DefaultIssuer)); } - else if (party.IsSocialSecurityNumber()) + else if (party.WithoutPrefix().IsSocialSecurityNumber()) { - resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.PersonIdAttribute, party, DefaultType, DefaultIssuer)); + resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.PersonIdAttribute, party.WithoutPrefix(), DefaultType, DefaultIssuer)); } else { - throw new InvalidOperationException("RecipientId is not a valid organization or person number"); + throw new InvalidOperationException("RecipientId is not a valid organization or person number: " + party); } if (instanceId is not null) {