Form authentication (form authentication) issues

Source: Internet
Author: User

Objective

Recently, there have been some problems in making forms authentication in ASP.

Problem

When a form is certified, the ticket is decrypted from the cookie value in the postauthenticaterequest event. As follows:

        protected void application_postauthenticaterequest (Object sender, EventArgs e)        {            var authcookie = Request.cookies[formsauthentication.formscookiename];             if NULL )            {                var authticket = formsauthentication.decrypt (authcookie.value);                TODO ...             }        

There was no problem yesterday, but the following results were unexpectedly run again today:

This problem has never been met, only to resort to StackOverflow.

The final discovery requires the authentication method to be added to the configuration file:

   <authentication mode="Forms">         </authentication>

Resolve the issue as set up above.

Summarize

The above encryption and decryption Formsauthentication.encrypt and Decrypt are also related to machine key , as the above unresolved can be resolved by setting machine key.

Reference URL:

FormsAuthentication Unable to validate data

Configure MachineKey

Form authentication (form authentication) issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.