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 -->