Menu

Search

InstantASP Support

Help & Support


Forms authentication failed for the request. Reason: The ticket supplied was invalid


Error Messages

After installing InstantForum or InstantKB you may see the following error message from time to time within the server event viewer...

​Forms authentication failed for the request. Reason: The ticket supplied was invalid.

Whilst the exact cause of this error is not officially documented by Microsoft we've found adding a hard coded <machineKey> element into your InstantForum or InstantKB web.config resolves this problem.

This would suggest the private keys used for encryption and decryption are expiring resulting in a invalid authentication cookie and the above exception message. To resolve this we would suggest you generate your own unique private keys and hard code these into your InstantForum or InstantKB web.config as discussed below. 

What Is The <machineKey> element

The <machineKey> element configures keys to use for encryption and decryption of forms authentication cookie data and view state data, and for verification of out-of-process session state identification. This section can be declared at the machine, site, and application levels, but not at the subdirectory level.

If you don't explicitly specify a <machineKey> element by default the .NET framework will automatically generate the encryption and description keys for each application within IIS. 

Adding a <machineKey> element

To resolve the above error message open your InstantForum or InstantKB web.config file within NotePad or similar text editor. Locate the existing <authentication> element. This will look like so...

<authentication mode="Forms">
      <forms name="InstantASP" loginUrl="Logon.aspx" protection="All" slidingExpiration="true" path="/" />
</authentication> 

Add your <machineKey> element just below the <authenticaiton> element as shown below...

<authentication mode="Forms">
      <forms name="InstantASP" loginUrl="Logon.aspx" protection="All" slidingExpiration="true" path="/" />
</authentication> 
<machineKey validationKey="40923D2776AB474BD46356697B1CD3F035753A9156DE06310A96612E938D594D5367828E322F29F404518177D5D0E188015EE485317D50134CC70A8350724EA5"
decryptionKey="8F5D29504BE809CF0E180276FCC97597A50C180F4594CAFF5CB7C03AF3A8052D"
validation="SHA1" decryption="Auto" />

For a complete references of all attributes supported within the <machineKey> element please refer to https://msdn.microsoft.com/en-us/library/w8h3skw9%28v=vs.71%29.aspx

The value for the validationKey and decryptionKey attributes must be a minimum of 40 characters and a maximum of 128 characters long. The recommended key length is 128 hexadecimal characters.

We would strongly suggest you generate your own private keys if you choose to hard code the <machioneKey> element within your web.config and don't use the keys shown in this example. 

There a number of handy tools that allow you to generate new <machineKey> elements which are linked below...

DeveloperFusion - Generate ASP.NET Machine Keys
Black Belt Coder - ASP.NET MachineKey Generator

Alternatively you can use IIS to generate new encryption keys for you.

That's It!

Once you've hard coded the <machneKey> element within your web.config you should no longer see the above error message within your server event logs.


Related Links



Optionally provide private feedback to help us improve this article...

Thank you for your feedback!


Comments require login or registration.

Details

Product: InstantKB, InstantForum
Version: All Versions
Type: ERRMSG
Level: Intermediate
Article not rated yet.
Article has been viewed 9.3K times.
Last Modified: 2 Years Ago
Last Modified By: Ryan Healey

Options

Similar Articles


Tags