DOWNLOAD DEMO
Current Version: 2.4.0.4 2014-07-18
Need a hand? Join the community.

Invalid value for 'encryptedTicket' parameter.

This thread is closed to new posts. You must sign in to post in the forums.
9/14/2011 4:48:00 AM
Koe
Gravatar
Total Posts 29

Invalid value for 'encryptedTicket' parameter.

Hi,

One of our users report that he cannot access the pages in the website, but it doesn't occurs for the other user accounts.

In the system log, I find the exception which is telling that:

 

2011-09-14 15:52:44,693 ERROR mojoPortal.Web.Global - XXX.XXX.XXX.XXX-en-US - /reports-selection.aspx
System.ArgumentException: Invalid value for 'encryptedTicket' parameter.
   at System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket)
   at mojoPortal.Web.mojoRoleProvider.GetRolesFromCookie()
   at mojoPortal.Web.mojoRoleProvider.GetRolesForUser(String userName)
   at System.Web.Security.RolePrincipal.IsInRole(String role)
   at mojoPortal.Business.WebHelpers.WebUser.IsInRole(String role)
   at mojoPortal.Business.WebHelpers.WebUser.get_IsAdmin()
   at mojoPortal.Business.WebHelpers.WebUser.get_IsAdminOrContentAdmin()
   at mojoPortal.Web.UI.AnalyticsAsyncTopScript.DoInit()
   at mojoPortal.Web.UI.AnalyticsAsyncTopScript.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

 

I have done some test on that:

1. For the same computer and internet explorer, he can access the page using other user accounts.

2. It does not solved by clearing the explorer cache or using other computer.

3. The error only happens when accessing pages need to check the permission (i.e. "All users" do not have view permission of the page)

4. It can be solved if some specific role membership of that user is removed. (But I have tested other user account having that role can access the pages)

5. The user account having the problem have been created half year ago, the account is used quite frequently and do not have problem.

 

Do anyone have some suggestions on prevent or solve this problem and what is the reason of the error?

9/14/2011 7:46:50 AM
Gravatar
Total Posts 17901

Re: Invalid value for 'encryptedTicket' parameter.

This can only happen when trying to decrypt an authentication token from a cookie with an invalid decryption key. The cause of this is the user was authenticated and then someone changed the machine key in Web.config and now it cannot decrypt the token. Or maybe you upgraded the site to a new version of mojoPortal and forgot to restore the custom machine key in web.config

It should be solved by logging out and logging in again, ie have the user visit the /Logoff.aspx page in the root of your site, or clearing the browser of all cookies should also solve it.

Hope that helps,

Joe

9/18/2011 10:45:55 PM
Koe
Gravatar
Total Posts 29

Re: Invalid value for 'encryptedTicket' parameter.

Hi Joe,

Here is some test result.

1. It does not solved if logout and login again.

2. It does not solved if clear the browser cookies.

3. It does not solved if I recycle the application pool, or restart the IIS.

4. I have not changed the mojoportal version and do not change the machine key since the site is opened (for near 1 year), but the problem only happen recently.

5. I have tried to set viewStateEncryptionMode in web.config to "Never", but it does not solved the problem.

 

I have checked for the error that I think sometimes it return a null value for some roles, so it can be solved if I delete those role membership for the user, but I does not solved the problem as the user missed some roles they should have.

Did they is some limitation for the role settings? For example the maximum role number the system/user can have? I have seen some documents say that it would cause this error if too many roles is added to a single user.

9/26/2011 2:06:38 PM
Gravatar
Total Posts 22

Re: Invalid value for 'encryptedTicket' parameter.

I have the same problem, and it happens only with Internet Explorer. It does seem it is related to a user having too many roles.

9/26/2011 3:48:12 PM
Gravatar
Total Posts 17901

Re: Invalid value for 'encryptedTicket' parameter.

It is important to build a role structure that does not require users to be in lots of them, a user could be in a handful of roles but the limitation is that the roles are tracked by a cookie and you can only fit so much data in a cookie so its best to design a hierarchy of permission levels and keep the number of roles any given user is in to a reasonable amount. Users in the Admins Role don't need to be in any other roles. Similarly users in the Content Administrators role don't need to be in specific roles for editing specific sections of a site. I guess its possible if the user is in too many roles it could overflow the cookie size limit and possibly cause this error.

Hope that helps,

Joe

1/3/2012 2:31:26 PM
Gravatar
Total Posts 21

Re: Invalid value for 'encryptedTicket' parameter.

We're having the same problem when a user tries to edit their personal account information - there's no error if they try to update their email address. We haven't changed our machine key, or any key. The users that we're having problems with are only in the Authenticated Users group.

Is there anything else I can check? Can I verify the users who get the error are using the correct key to decrypt?

1/3/2012 3:10:40 PM
Gravatar
Total Posts 17901

Re: Invalid value for 'encryptedTicket' parameter.

Hi Fred,

Are you getting this exact same error with the same stack trace that Koe posted or just a similar error?

What version of mojoPortal are you using?

Have you tried having the user clear all browser cookies and login again?

There was a different error related to the role cookie reported recently on this thread that appeared to be related to a recent security update for ASP.NET, and as mentioned on that thread I patched the 2.3.7.6 release to handle the error.

Hope that helps,

Joe

1/3/2012 3:33:38 PM
Gravatar
Total Posts 21

Re: Invalid value for 'encryptedTicket' parameter.

Poops, my bad! The error I got was not the same as Koe's, but it was the same one related to the ASP.NET security release. Thanks for the link to the fix!

You must sign in to post in the forums. This thread is closed to new posts.

mojoPortal Hosting Made Easy

Monetize Your Site With Site Membership Pro!

Go Mobile with mojoPortal and Mobile Kit Pro!