diff --git a/src/Identity/Startup.cs b/src/Identity/Startup.cs index 9a7874820d..dda5fb03ee 100644 --- a/src/Identity/Startup.cs +++ b/src/Identity/Startup.cs @@ -213,7 +213,11 @@ public class Startup app.UseRouting(); // Add Cors - app.UseCors(policy => policy.SetIsOriginAllowed(o => CoreHelpers.IsCorsOriginAllowed(o, globalSettings)) + app.UseCors(policy => policy.SetIsOriginAllowed(o => + CoreHelpers.IsCorsOriginAllowed(o, globalSettings) || + + // If development - allow requests from the Swagger UI so it can authorize + (Environment.IsDevelopment() && o == globalSettings.BaseServiceUri.Api)) .AllowAnyMethod().AllowAnyHeader().AllowCredentials()); // Add current context