Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:24:49+00:00 2026-06-05T15:24:49+00:00

I am working on a custom SSO solution and running into some problems with

  • 0

I am working on a custom SSO solution and running into some problems with FormsAuthentication.Encrypt and FormsAuthentication.Decrypt.

When a user is authenticated in my HttpModule I build up a FormsAuthenticationTicket object, encrypting it with FormsAuthentication.Encrypt and setting it on the Response. Then on subsequent calls on my site, I get the cookie value and call FormsAuthentication.Decrypt. If you have a token there for a valid user I pass you through without requiring reauthentication.

I have set a static MachineKey in my Web.configs.

The issue is that for certain pages the Decrypt method is failing for some .css and .js files (though not all, and not for the brunt of the application), with an InvalidEncryptedTicket error.

Anyone have any idea what would cause this?

//Encryption on successful authentication
FormsAuthenticationTicket fmaTicket = new FormsAuthenticationTicket(0, ticket.TicketValue.ToString(), DateTime.Now,
          DateTime.Now + new TimeSpan(0, 0, 20, 0), false, ticket.Principal);
authCookie = new HttpCookie("AUTHTICKET", FormsAuthentication.Encrypt(fmaTicket));

//Decryption when cookie is present
FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:24:50+00:00Added an answer on June 5, 2026 at 3:24 pm

    I switched this to use Rijindel Managed encryption classes (http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx) instead of the FormsAuthentication Encrypt and Decrypt and had no more issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working custom UserNamePasswordValidator that calls into my Oracle DB. This class
I'm working on a custom user control that essentially displays a name value pair
I'm working a custom workflow activity and would like to allow the user to
I'm working on custom WCF authentication and authorization and found some articles about UserNamePasswordValidator
While working on some custom validators in WPF, one of my co-workers pointed me
I am working with some custom ajax functionality using Telerik's MVC Grid and I
I am working on custom build software for postcode lookup based on Royal Mail
In some instances, I prefer working with custom objects instead of strongly typed datasets
I'm working on a custom user control. How can I prevent the HEIGHT ONLY
I'm working on a custom CMS that has some built-in modules (calendar, weather, etc.)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.