Implementation of cross-origin login information sharing in Asp.net forms Authentication Mode

Source: Internet
Author: User
Background: I previously created a user management background in my company, which is implemented based on ASP.net Forms authentication. Recently, some colleagues proposed that they should add their management backend to my management backend to prevent content Department colleagues from logging on to the backend for content management. For some reason, his Program It must be stored in a directory on another machine and another site. All development tools are vs2008. After some hard work, I finally got it done. Now, the process is recorded for memo.
Let's assume that the site I have prepared is a (http://a.abc.com), and the site my colleague wants to join is a virtual directory XXX of site B (http:// B .abc.com. The method is to configure the Web. config.
1. Configure the system. Web/machinekey node. Be sure to keep this node completely consistent for 2 sites; see: http://www.aspnetresources.com/tools/keycreator.aspx generation
2.2 web. config are configured as Forms authentication (system. Web/authentication section );
3.2 web. in the config section, configure system. the Web/httpcookies are The complete configuration is as follows: Authentication configuration section <! -- Authentication configuration section -->
< Authentication Mode = "Forms" >
< Forms Loginurl = "~ /Default. aspx" Defaurl URL = "~ /Mainindex. aspx" Name = ". Mymanage"
Protection = "All" Domain = ".Abc.com"
Path = "/" Slidingexpiration = "True" Timeout = "60" > </ Forms >
</ Authentication >

<Machinekey
Validationkey= "Success"
Decryptionkey= "Success"
Validation= "Sha1"
Decryption= "AES"
/>

< Authorization >
< Deny Users = "? " />
</ Authorization >
< Httpcookies Domain = ".Abc.com" />
<! -- End authentication configuration section -->

Related Article

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.