Skip to content

Commit

Permalink
Audit log valid claims by default for AAD vs. IdentityServer (#386)
Browse files Browse the repository at this point in the history
* Audit log valid claims by default for AAD vs. IdentityServer

* Don't need LastModifiedClaims=appid in StartupWithTraceAuditLogger anymore
  • Loading branch information
cunninghamjc authored Mar 15, 2019
1 parent 2b009ac commit 36e6a4c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Microsoft.Health.Fhir.Web
public class DevelopmentIdentityProviderConfiguration
{
public const string Audience = "fhir-api";
public const string LastModifiedClaim = "appid";

public bool Enabled { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public override void Load()
// add properties related to the development identity provider.
Data["DevelopmentIdentityProvider:Enabled"] = bool.TrueString;
Data["FhirServer:Security:Authentication:Audience"] = DevelopmentIdentityProviderConfiguration.Audience;
Data["FhirServer:Security:LastModifiedClaims:0"] = DevelopmentIdentityProviderConfiguration.LastModifiedClaim;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.Health.Fhir.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"Authority": "https://localhost:44348"
},
"LastModifiedClaims": [
"client_id"
"oid"
],
"Authorization": {
"Enabled": true
Expand Down Expand Up @@ -74,4 +74,4 @@
"ApplicationInsights": {
"InstrumentationKey": ""
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Microsoft.Health.Fhir.Api.Features.Audit;
using Microsoft.Health.Fhir.Core.Configs;
using Microsoft.Health.Fhir.Web;

namespace Microsoft.Health.Fhir.Tests.E2E.Rest.Audit
Expand All @@ -25,12 +23,6 @@ public override void ConfigureServices(IServiceCollection services)
base.ConfigureServices(services);

services.Replace(new ServiceDescriptor(typeof(IAuditLogger), typeof(TraceAuditLogger), ServiceLifetime.Singleton));

// Configure the test server to log a claim that is used in both local and integration environments.
ServiceProvider serviceProvider = services.BuildServiceProvider();
var securityConfigurationOptions = serviceProvider.GetService<IOptions<SecurityConfiguration>>();
securityConfigurationOptions.Value.LastModifiedClaims.Clear();
securityConfigurationOptions.Value.LastModifiedClaims.Add("appid");
}
}
}

0 comments on commit 36e6a4c

Please sign in to comment.