简体   繁体   English

ASP.NET成员提供程序 - 单一登录

[英]ASP.NET Membership Provider - Single Login

I'm considering utilizing the ASP.NET Membership Provider for a few different web apps/tools with a single login approach. 我正在考虑使用ASP.NET成员资格提供程序通过一种登录方法来使用几种不同的Web应用程序/工具。

REQUIREMENTS 要求

User logs in to my.domain.com and sees a list of apps/tools that they have permission to use. 用户登录my.domain.com并查看他们有权使用的应用/工具列表。 The user selects the tool they'd like to use and clicks the link. 用户选择他们想要使用的工具并单击该链接。 When the tool opens, it is able to identify that they are currently logged in and who they are to identify any unique permissions to the application. 当工具打开时,它能够识别出他们当前已登录以及他们要识别应用程序的任何唯一权限。

I know that each app could simply point to the same back end Membership Provider DB, however will each app require a login or will it be able to identify if the user is already logged in? 我知道每个应用程序可以简单地指向相同的后端成员资格提供程序数据库,但是每个应用程序是否需要登录,或者它是否能够识别用户是否已经登录?

Each app can use the same login as long as the ApplicationName is the same and they are pointing to the same database. 只要ApplicationName相同并且它们指向同一个数据库,每个应用程序都可以使用相同的登录名。

See the answer here: http://forums.asp.net/t/1322863.aspx for more details. 请参阅此处的答案: http//forums.asp.net/t/1322863.aspx了解更多详情。

Edit - added 编辑 - 添加

It's also covered here: 它也包括在这里:

http://msdn.microsoft.com/en-us/library/ms998347.aspx http://msdn.microsoft.com/en-us/library/ms998347.aspx

  1. You will want to generate a common machineKey section to share amongst all sites. 您将需要生成一个公共machineKey部分以在所有站点之间共享。

  2. You will want to ensure that the application names are identical 您需要确保应用程序名称相同

  3. You will want to ensure the connection strings are identical 您需要确保连接字符串相同

  4. You will want to ensure that allowCrossAppRedirects in forms element is enabled 您需要确保启用表单元素中的allowCrossAppRedirects

If the tools are under the same domain/sub-domain, you'll have no problem. 如果这些工具位于同一个域/子域下,那么您就没有问题。 This is limitation by the cookies used to keep the logged user's token. 这是用于保留已记录用户令牌的cookie的限制。 If you need cross-domain unified login you can review Windows Identity Foundation . 如果您需要跨域统一登录,可以查看Windows Identity Foundation

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

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