diff --git a/bitwarden_license/src/Sso/Startup.cs b/bitwarden_license/src/Sso/Startup.cs index 97873fa438..a3f37e1a18 100644 --- a/bitwarden_license/src/Sso/Startup.cs +++ b/bitwarden_license/src/Sso/Startup.cs @@ -90,15 +90,20 @@ public class Startup public void Configure( IApplicationBuilder app, - IWebHostEnvironment env, + IWebHostEnvironment environment, IHostApplicationLifetime appLifetime, GlobalSettings globalSettings, ILogger logger) { + if (environment.IsDevelopment() || globalSettings.SelfHosted) + { + Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; + } + // Add general security headers app.UseMiddleware(); - if (!env.IsDevelopment()) + if (!environment.IsDevelopment()) { var uri = new Uri(globalSettings.BaseServiceUri.Sso); app.Use(async (ctx, next) => @@ -114,7 +119,7 @@ public class Startup app.UseForwardedHeaders(globalSettings); } - if (env.IsDevelopment()) + if (environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseCookiePolicy(); diff --git a/src/Identity/Startup.cs b/src/Identity/Startup.cs index 31d07b065a..561a0d1955 100644 --- a/src/Identity/Startup.cs +++ b/src/Identity/Startup.cs @@ -169,14 +169,19 @@ public class Startup public void Configure( IApplicationBuilder app, - IWebHostEnvironment env, + IWebHostEnvironment environment, GlobalSettings globalSettings, ILogger logger) { + if (environment.IsDevelopment() || globalSettings.SelfHosted) + { + Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; + } + // Add general security headers app.UseMiddleware(); - if (!env.IsDevelopment()) + if (!environment.IsDevelopment()) { var uri = new Uri(globalSettings.BaseServiceUri.Identity); app.Use(async (ctx, next) => @@ -193,7 +198,7 @@ public class Startup } // Default Middleware - app.UseDefaultMiddleware(env, globalSettings); + app.UseDefaultMiddleware(environment, globalSettings); if (!globalSettings.SelfHosted) { @@ -201,7 +206,7 @@ public class Startup app.UseMiddleware(); } - if (env.IsDevelopment()) + if (environment.IsDevelopment()) { app.UseSwagger(); app.UseDeveloperExceptionPage(); diff --git a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs index e383d36916..1b10349630 100644 --- a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs +++ b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs @@ -471,6 +471,11 @@ public static class ServiceCollectionExtensions addAuthorization.Invoke(config); }); } + + if (environment.IsDevelopment() || globalSettings.SelfHosted) + { + Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; + } } public static void AddCustomDataProtectionServices( @@ -660,7 +665,6 @@ public static class ServiceCollectionExtensions Constants.BrowserExtensions.OperaId }; } - }); }