Browse Source

New option.

pull/885/head
Sebastian 4 years ago
parent
commit
466534e152
  1. 8
      backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs
  2. 2
      backend/src/Squidex/Config/MyIdentityOptions.cs
  3. 6
      backend/src/Squidex/Startup.cs
  4. 3
      backend/src/Squidex/appsettings.json

8
backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs

@ -5,6 +5,7 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.DataProtection.KeyManagement; using Microsoft.AspNetCore.DataProtection.KeyManagement;
@ -115,6 +116,13 @@ namespace Squidex.Areas.IdentityServer.Config
options.UseAspNetCore(); options.UseAspNetCore();
}); });
services.Configure<AntiforgeryOptions>((services, options) =>
{
var identityOptions = services.GetRequiredService<IOptions<MyIdentityOptions>>().Value;
options.SuppressXFrameOptionsHeader = identityOptions.SuppressXFrameOptionsHeader;
});
services.Configure<OpenIddictServerOptions>((services, options) => services.Configure<OpenIddictServerOptions>((services, options) =>
{ {
var urlGenerator = services.GetRequiredService<IUrlGenerator>(); var urlGenerator = services.GetRequiredService<IUrlGenerator>();

2
backend/src/Squidex/Config/MyIdentityOptions.cs

@ -73,6 +73,8 @@ namespace Squidex.Config
public bool ShowPII { get; set; } public bool ShowPII { get; set; }
public bool SuppressXFrameOptionsHeader { get; set; }
public bool IsAdminConfigured() public bool IsAdminConfigured()
{ {
return !string.IsNullOrWhiteSpace(AdminEmail) && !string.IsNullOrWhiteSpace(AdminPassword); return !string.IsNullOrWhiteSpace(AdminEmail) && !string.IsNullOrWhiteSpace(AdminPassword);

6
backend/src/Squidex/Startup.cs

@ -43,10 +43,8 @@ namespace Squidex
services.AddSquidexIdentityServer(); services.AddSquidexIdentityServer();
services.AddSquidexAuthentication(config); services.AddSquidexAuthentication(config);
services.AddSquidexImageResizing(config);
services.AddSquidexAssetInfrastructure(config);
services.AddSquidexSerializers();
services.AddSquidexApps(config); services.AddSquidexApps(config);
services.AddSquidexAssetInfrastructure(config);
services.AddSquidexAssets(config); services.AddSquidexAssets(config);
services.AddSquidexBackups(); services.AddSquidexBackups();
services.AddSquidexCommands(config); services.AddSquidexCommands(config);
@ -58,6 +56,7 @@ namespace Squidex
services.AddSquidexGraphQL(); services.AddSquidexGraphQL();
services.AddSquidexHealthChecks(config); services.AddSquidexHealthChecks(config);
services.AddSquidexHistory(config); services.AddSquidexHistory(config);
services.AddSquidexImageResizing(config);
services.AddSquidexInfrastructure(config); services.AddSquidexInfrastructure(config);
services.AddSquidexLocalization(); services.AddSquidexLocalization();
services.AddSquidexMigration(config); services.AddSquidexMigration(config);
@ -67,6 +66,7 @@ namespace Squidex
services.AddSquidexRules(config); services.AddSquidexRules(config);
services.AddSquidexSchemas(); services.AddSquidexSchemas();
services.AddSquidexSearch(); services.AddSquidexSearch();
services.AddSquidexSerializers();
services.AddSquidexStoreServices(config); services.AddSquidexStoreServices(config);
services.AddSquidexSubscriptions(config); services.AddSquidexSubscriptions(config);
services.AddSquidexTelemetry(config); services.AddSquidexTelemetry(config);

3
backend/src/Squidex/appsettings.json

@ -507,6 +507,9 @@
// Enable password auth. Set this to false if you want to disable local login, leaving only 3rd party login options. // Enable password auth. Set this to false if you want to disable local login, leaving only 3rd party login options.
"allowPasswordAuth": true, "allowPasswordAuth": true,
// Specifies whether to suppress the generation of X-Frame-Options header which is used to prevent ClickJacking.
"suppressXFrameOptionsHeader": false,
// Initial admin user. // Initial admin user.
"adminEmail": "", "adminEmail": "",
"adminPassword": "", "adminPassword": "",

Loading…
Cancel
Save