0

I'm trying to run Kentico 13 CMS in preview mode but i'm getting the following error.

An unhandled exception has occurred while executing the request.
Message: Try reloading the administration interface. The user was not found in the JWT token, nor in the current virtual context URL.

Exception type: CMS.Helpers.InvalidVirtualContextException
Stack trace:
at Kentico.Content.Web.Mvc.VirtualContextPrincipalRetriever.GetPrincipal(String jwtToken)
at Kentico.Content.Web.Mvc.VirtualContextRequestPrincipalRetriever.Retrieve(HttpRequest request)
at Kentico.Web.Mvc.AuthenticationHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at IMPlus.Web.UI.Middleware.CultureMiddleware.<>c__DisplayClass3_0.<g__invokeImplementation|0>d.MoveNext() in C:\Users\inraja03\source\repos\IM Plus\BackEnd\IMPlus.Web.UI\Middleware\CultureMiddleware.cs:line 45
--- End of stack trace from previous location ---
at IMPlus.Web.UI.Middleware.CultureMiddleware.InvokeAsync(HttpContext httpContext) in C:\Users\inraja03\source\repos\IM Plus\BackEnd\IMPlus.Web.UI\Middleware\CultureMiddleware.cs:line 28
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Kentico.Content.Web.Mvc.ContentOutputMiddleware.InvokeAsync(HttpContext context)
at Kentico.Web.Mvc.KenticoRequestLocalizationMiddleware.InvokeAsync(HttpContext context)
at Kentico.Content.Web.Mvc.PageRedirectionContextMiddleware.InvokeAsync(HttpContext context)
at Kentico.Web.Mvc.KenticoRequestEventsMiddleware.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Few things which i observed

  1. We have integrated Okta SSO authentication on live site. It works
    fine when i disable Okta. I am able to view the page under preview
    mode after i have disabled Okta.

  2. This issue occurs only in our UAT and Prod instance not in
    development instance. Our Admin site and Live Site are mapped under the same domain.

  • Tried this solution as well. [https://stackoverflow.com/questions/71225702/error-on-page-preview-after-upgrade-from-kentico-12-to-13?rq=1](https://stackoverflow.com/questions/71225702/error-on-page-preview-after-upgrade-from-kentico-12-to-13?rq=1) Still not working. – Arjun Rajan Mar 21 '23 at 15:05
  • I'd try clearing my cookies, that can sometimes fix these anomalies – trucker_jim Mar 21 '23 at 15:16
  • What do you mean by "Our Admin site and Live Site are mapped under the same domain."? If the admin app is nested under the live site, this is not supported and you should separate the admin app. Either to run on different domain (different site) or, make the live app to run in a virtual app as well so the apps are running side by side, not nested. – jurajo Mar 22 '23 at 04:28
  • @trucker_jim tried that still doesn't work. – Arjun Rajan Mar 22 '23 at 19:51
  • @jurajo Noted. Will work on that – Arjun Rajan Mar 22 '23 at 19:53

0 Answers0