简体   繁体   English

解决方案中两个项目的asp.net成员身份

[英]asp.net membership for two projects in a solution

I have two web projects both using the same database and they are in the same solution. 我有两个使用相同数据库的Web项目,它们在相同的解决方案中。 One of them using asp.net membership.I want also include the other one.How can I manage this? 其中一个使用asp.net成员身份。我还希望包含另一个。我该如何管理?

Configure the second app to use the same membership database. 配置第二个应用程序以使用相同的成员数据库。 Change the applicationName property of the membership provider config in your web.config to something different from the first app. 将您的web.config中的成员资格提供程序config的applicationName属性更改为与第一个应用程序不同的名称。

I've done this for nested applications recently. 我最近为嵌套应用程序完成了此操作。 Its not too difficult. 它不太困难。

In addition to Kyle's points, you need to: 除了Kyle的观点,您还需要:

  • make sure the the machineKeys are the same for both web applications 确保两个Web应用程序的machineKeys相同
  • configure loginUrl's to resolve to the same absolute path 配置loginUrl以解析为相同的绝对路径
  • if you're using cookies you need to make sure that the domain is set to a value available to both web applications 如果您使用的是Cookie,则需要确保将域设置为两个Web应用程序都可以使用的值
  • also for cookies, if your web applications are nested at diferent levels in a domain make sure that the path attribute is set to "/" 同样对于Cookie,如果您的Web应用程序嵌套在域中的不同级别,请确保将path属性设置为“ /”

See this blog post for more detail. 有关更多详细信息 ,请参见此博客文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM