JWT Error in Page builder

Patrick Blume asked on September 29, 2022 05:36

Hi,

I am getting the following exception and unsure how to solve it.

CMS.Helpers.InvalidVirtualContextException
Try reloading the administration interface. The user was not found in the JWT token, nor in the current virtual context URL.

Any suggestions?

Recent Answers


Juraj Ondrus answered on September 29, 2022 06:30

What is the hotfix applied to your projects? Does the hotfix version applied on admin app matches the version of the Kentico NuGet packages on the live site app? Please, check also the following:

  • Live site runs on HTTPS (the live site presentation URL uses HTTPS): it looks like your Live site already runs on HTTPS

  • SameSite mode is configured correctly

  • Browser does not block 3rd-party cookies

  • If you are using a self-signed certificate for the live site in the dev environment - you need to accept this certificate in your browser and reload the administration interface

0 votesVote for this answer Mark as a Correct answer

Patrick Blume answered on September 30, 2022 02:20

I am trying to use hotfix 13.0.82. This is after successfully upgrading from Kentico 12 SP to Kentico 13. Just noticed there is now a .84. Should I upgrade that that and try again?

0 votesVote for this answer Mark as a Correct answer

Patrick Blume answered on September 30, 2022 06:56

Here is the full error, could our tokens from the live site be missing something?

BIG4.WebSite.MvcApplication.Application_Error
Global Exception caught
CMS.Helpers.InvalidVirtualContextException
Try reloading the administration interface. The user was not found in the JWT token, nor in the current virtual context URL.
System.Security.Claims.ClaimsPrincipal GetPrincipal(System.String)
   at Kentico.Content.Web.Mvc.VirtualContextPrincipalRetriever.GetPrincipal(String jwtToken)
   at Kentico.Content.Web.Mvc.VirtualContextPrincipalAssigner.SetVirtualContextPrincipal(IVirtualContextPrincipalRetriever virtualContextPrincipalRetriever)
   at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler 1 h, TArgs e)
   at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List1 list, TArgs e, Boolean important)
   at CMS.Base.SimpleHandler2.RaiseExecute(TArgs e)
   at CMS.Base.SimpleHandler2.StartEvent(TArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on September 30, 2022 08:26

Could you please confirm that your site runs on HTTPS as well as the admin app, SameSite is configured, SSL cert is trusted? Have you tried checking other threads on this error and the suggestions there?

0 votesVote for this answer Mark as a Correct answer

Patrick Blume answered on October 3, 2022 01:50

Both running on https, Same Site is configured, SSL certs are trusted and performed all the steps in that thread.

0 votesVote for this answer Mark as a Correct answer

Patrick Blume answered on October 3, 2022 04:59 (last edited on October 3, 2022 05:00)

Error Information from the 500 page.

Detailed Error Information:
Module     CMSApplicationModule
Notification       AuthenticateRequest
Handler    CMSPreviewLinkHandler
Error Code     0x00000000
Requested URL      https://dev.big4.com.au:443/holiday-deals?instance=98e8f865-0f13-4642-a51e-53881b6e7cb1&uh=9249e50953fde3457bed8d5e07d54d5133292de31c16032c2c7faec0e11a77f1&editmode=1&administrationUrl=https%3A%2F%2Fadmin.dev.big4.com.au%2F
Logon Method       Bearer
Logon User     anonymous
0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 3, 2022 10:59

Are you using any custom CSP headers set or any other customization in the web.config file? How is your preview mode support implemented and configured?

0 votesVote for this answer Mark as a Correct answer

Patrick Blume answered on October 4, 2022 05:22

Nothing changed between 13.0.82 and 13.0.84 but the preview mode worked in 82 but not 84.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.