使用DNN身份验证和授权信息从另一个ASP.NET应用程序 [英] Using DNN authentication and authorization info from another ASP.NET app

查看:236
本文介绍了使用DNN身份验证和授权信息从另一个ASP.NET应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET Web应用程序K,有它自己的身份验证和授权,建立在SimpleMembershipProvider。

I have an ASP.NET web application "K" that has its own authentication and authorization built on SimpleMembershipProvider.

现在我想建立一个具有应用K和DNN,在某种程度上,用户将登录到DNN应用一个网站,我有DNN应用程序中的一个按钮,将跳转到应用程序K。

Now I want to set up a web site that has application "K" and DNN, in a way that the user will log in to DNN app and I have a button within DNN app that will jump to app "K".

在K,我想实现这些行为。

Within "K", I would like to implement these behaviors.


  1. 如果用户没有登录,回到DNN的主页。

  2. 如果用户已经登录,但不具有DNN一个K-用户的角色,显示请与管理员联系的消息。

  3. 如果用户登录并具有K-用户,在DNN的角色,允许用户使用的应用程序和往常一样。

这是全新的网站,所以我没有任何约束。我可以把KDNN下(反之亦然,但不知道为什么我会做这样的说法),我可以把K旁边的DNN,把相同的machineKey分享饼干,我甚至不有使用DNN,它可以是任何CMS,只要它具有良好的,轻松地填写信息。

This is brand new site so I do not have any constraint. I can put "K" under DNN (or vice versa, but not sure why I would do it that way), I can put "K" next to DNN and give the same machineKey to share cookies, I don't even have to use DNN, it can be any CMS as long as it has nice and easy way to fill in information.

我必须使用我的谷歌搜索关键字错误。这似乎很基本的需要,但无法找到确切的文章,可以告诉我怎么做。

I must be using wrong keyword on my googling. It seems very basic need but can't find exact article that can show me how to do it.

任何帮助将是非常美联社preciated。

Any helps would be much appreciated.

推荐答案

下面是我如何解决它。


  • 把DNN和K为Web根的直接子兄弟姐妹。

  • 请DNN和K具有相同的machineKey。

  • 用户迁移SQL脚本,从DNN为K。

  • 请从DNN为K。链接

  • 修改Kweb.config中的身份验证像一节。关键的一点是loginUrl和名称。

  • Put DNN and "K" as direct child siblings of web root.
  • Make DNN and "K" have the same MachineKey.
  • Write User Migration sql script, from DNN to "K".
  • Make a link from DNN to "K".
  • Modify "K" web.config authentication section like below. Key point is loginUrl and name.

>

<authentication mode="Forms">
  <forms loginUrl="/dnn/Login.aspx" defaultUrl="~/" name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" />
</authentication>


  • 禁用任何code中的K,允许用户直接登录到K。

  • 当用户访问K的第一次,执行用户迁移SQL脚本。 (你可以在适合你的最随时启动迁移脚本。)

  • 现在,用户将登录到DNN,然后点击一个链接访问K。发生这种情况时,K可以表现为,如果用户实际登录使用K的应用程序,就像读从Web.Security等附带免费的,因为你做了它的窗体身份验证cookie名称和machineKey中两个应用程序之间同步角色

    Now, the user will log in onto DNN, and click a link to access "K". When this happens, "K" can behave as if the user actually logged in using "K" application, like reading roles from Web.Security, etc. That comes for free since you made its forms authentication cookie name and MachineKey synced between two applications.

    这篇关于使用DNN身份验证和授权信息从另一个ASP.NET应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆