diff --git a/README.md b/README.md index 4de5a7ba..239667ec 100644 --- a/README.md +++ b/README.md @@ -45,15 +45,18 @@ If you want more information about the Cloud plugin for the CLI then you access ## Running the MVP Site To run the MVP site you will need to create a Development instance of your settings. -To this duplicate the `./headapps/MvpSite/Mvp.Project.MvpSite.Rendering/appsettings.json` and name it `appsettings.Development.json`. Then provide the Sitecore instance, and Okta sections, it's completed it look something like: + +Duplicate the `./headapps/MvpSite/Mvp.Project.MvpSite.Rendering/appsettings.json` and name it `appsettings.Development.json`. + +Populate the Sitecore, and Okta sections. You can find the `EdgeContextId` & `EditingSecret` in the XMC Deploy application, in the Developer Settings section for your environment. The Okta settings are available after completing the Okta Developer sign-up linked above. + +When completed it will look something like: ```json "Sitecore": { - "InstanceUri": "https://xmc-XXX-XXX-XXX.sitecorecloud.io/", - "LayoutServicePath": "/sitecore/api/graph/edge", - "DefaultSiteName": "mvp-site", - "NotFoundPage": "/404", - "ExperienceEdgeToken": "{B2F8A9B9-7203-4DCF-9314-8B28B043347E}" + "EdgeContextId": "XXX", + "EditingSecret": "XXX", + ... }, ... "Okta" : { diff --git a/authoring/platform/Packages.props b/authoring/platform/Packages.props index 261b928e..674ad9da 100644 --- a/authoring/platform/Packages.props +++ b/authoring/platform/Packages.props @@ -18,28 +18,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/headapps/MvpSite/Directory.Packages.props b/headapps/MvpSite/Directory.Packages.props index 4971eedd..63187b7a 100644 --- a/headapps/MvpSite/Directory.Packages.props +++ b/headapps/MvpSite/Directory.Packages.props @@ -5,17 +5,9 @@ true true 1.* - 0.0.7 + 0.0.11 - - - - - - - - diff --git a/headapps/MvpSite/MvpSite.Rendering/AppSettings/MvpSiteSettings.cs b/headapps/MvpSite/MvpSite.Rendering/AppSettings/MvpSiteSettings.cs index 5d24d76d..39e3c33f 100644 --- a/headapps/MvpSite/MvpSite.Rendering/AppSettings/MvpSiteSettings.cs +++ b/headapps/MvpSite/MvpSite.Rendering/AppSettings/MvpSiteSettings.cs @@ -4,32 +4,17 @@ public class MvpSiteSettings { public static readonly string Key = "Sitecore"; - public Uri? InstanceUri { get; set; } - - public string LayoutServicePath { get; set; } = "/sitecore/api/layout/render/jss"; - public string? DefaultSiteName { get; set; } public string? NotFoundPage { get; set; } public string MvpProfilePageItemPath { get; set; } = "/Directory/Profile/*"; - public bool EnableExperienceEditor { get; set; } - - public string JssEditingSecret { get; set; } = string.Empty; + public bool EnableEditingMode { get; set; } - public string? ExperienceEdgeToken { get; set; } + public string EditingSecret { get; set; } = string.Empty; - public Uri? LayoutServiceUri - { - get - { - if (InstanceUri == null) - { - return null; - } + public string? EdgeContextId { get; set; } - return new Uri(InstanceUri, LayoutServicePath); - } - } + public string? EditingPath { get; set; } } \ No newline at end of file diff --git a/headapps/MvpSite/MvpSite.Rendering/Startup.cs b/headapps/MvpSite/MvpSite.Rendering/Startup.cs index 9cb9ff9f..8b65f4ac 100644 --- a/headapps/MvpSite/MvpSite.Rendering/Startup.cs +++ b/headapps/MvpSite/MvpSite.Rendering/Startup.cs @@ -35,7 +35,7 @@ public void ConfigureServices(IServiceCollection services) // Register the GraphQL version of the Sitecore Layout Service Client for use against experience edge & local edge endpoint services.AddSitecoreLayoutService() - .AddGraphQlHandler("default", Configuration.DefaultSiteName!, Configuration.ExperienceEdgeToken!, Configuration.LayoutServiceUri!) + .AddGraphQlWithContextHandler("default", Configuration.EdgeContextId!, siteName: Configuration.DefaultSiteName!) .AsDefaultHandler(); services.AddFeatureUser(DotNetConfiguration); @@ -59,7 +59,7 @@ public void ConfigureServices(IServiceCollection services) .ForwardHeaders() // Enable support for the Experience Editor. - .WithExperienceEditor(options => { options.JssEditingSecret = Configuration.JssEditingSecret; }); + .WithExperienceEditor(options => { options.JssEditingSecret = Configuration.EditingSecret; }); // Register MVP Functionality specific services services.AddFeatureSocialServices() @@ -104,7 +104,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) // ReSharper restore StringLiteralTypo - Uri segments // The Experience Editor endpoint should not be enabled in production DMZ. // See the SDK documentation for details. - if (Configuration.EnableExperienceEditor) + if (Configuration.EnableEditingMode) { // Enable the Sitecore Experience Editor POST endpoint. app.UseSitecoreExperienceEditor(); diff --git a/headapps/MvpSite/MvpSite.Rendering/appsettings.json b/headapps/MvpSite/MvpSite.Rendering/appsettings.json index 57315349..0c2009dd 100644 --- a/headapps/MvpSite/MvpSite.Rendering/appsettings.json +++ b/headapps/MvpSite/MvpSite.Rendering/appsettings.json @@ -1,10 +1,11 @@ { "Sitecore": { - "InstanceUri": "<>", - "LayoutServicePath": "/api/graphql/v1", + "EdgeContextId": "", + "EditingSecret": "", + "EnableEditingMode": true, + "EditingPath": "/api/editing/config", "DefaultSiteName": "mvp-site", - "NotFoundPage": "/404", - "ExperienceEdgeToken": "<>" + "NotFoundPage": "/404" }, "AllowedHosts": "*", "https_port": 443,