简体   繁体   English

Windows身份验证Intranet和ASP.NET身份MVC网站之间的安全集成

[英]Security Integration between Windows Authentication Intranet and ASP.NET Identity MVC Website

I am looking for a solution whereby a pre-authenticated (windows authentication) intranet user can gain access to an MVC Website (ASP.NET Identity) without manually logging in. 我正在寻找一种解决方案,通过预先验证(Windows身份验证)的Intranet用户可以访问MVC网站(ASP.NET身份)而无需手动登录。

The MVC site currently has individual logins for manual login access to none authenticated users which is intended behaviour but what I want to achieve is SSO when accessing the MVC site from the Intranet. MVC站点当前具有单独的登录名,用于手动登录访问未经过身份验证的用户,这是预期的行为,但我想要实现的是从Intranet访问MVC站点时的SSO。 Either by passing an authentication cookie or bearer access token which i can decipher in my MVC website. 通过传递身份验证cookie或承载访问令牌,我可以在我的MVC网站中解密。

I currently have a plain old hyperlink from the intranet with a URL to the MVC application which is protected by a custom authorize attribute...I have overriden the AuthorizeAttribute but need the authentication to persist for the duration of the session. 我目前有一个来自内部网的普通旧超链接,其中包含一个受自定义授权属性保护的MVC应用程序的URL ...我已经覆盖了AuthorizeAttribute但需要在会话期间保持身份验证。

Please can someone provide some guidance on this with example code to generate the web request and the necessary headers and authenticate the windows user within the the MVC AuthorizeCore method? 有人可以通过示例代码提供一些指导来生成Web请求和必要的标题,并在MVC AuthorizeCore方法中对Windows用户进行身份验证吗?

Many thanks, 非常感谢,

Steveo Steveo

Here are the steps to solve your problem. 以下是解决问题的步骤。

  1. Open up Visual Studio 2013, hit FILE->New->Project. 打开Visual Studio 2013,点击FILE-> New-> Project。

  2. Under Project, hit Web->VisualStudio2012-> ASP.NET MVC4 Web Application. 在Project下,点击Web-> VisualStudio2012-> ASP.NET MVC4 Web Application。

在此输入图像描述

  1. Type your project name, check Create Folder, selected Intranet Application and hit Ok. 输入您的项目名称,选中Create Folder,选择Intranet Application并点击Ok。

在此输入图像描述

在此输入图像描述

  1. Modify the root web.config, add the allow users tag under the authorization tag: 修改根web.config,在授权标记下添加allow users标记:

  <authorization> <allow users="*" /> <deny users="?" /> </authorization> 

  1. Test run using Google Chrome and this home page should show up: 使用Google Chrome进行测试运行,此主页应显示:

在此输入图像描述

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

相关问题 Intranet站点的ASP.NET身份+ Windows身份验证 - ASP.NET Identity + Windows Authentication for Intranet Site 在ASP.NET MVC中使用自定义登录页面进行Intranet Windows身份验证 - intranet windows authentication with with custom login page in ASP.NET MVC ASP.NET MVC Windows身份验证集成 - ASP.NET MVC windows authentication integration 为ASP.NET MVC Intranet应用程序实施Windows身份验证的最佳方法是什么? - What's the best way to implement Windows Authentication for an ASP.NET MVC intranet application? 在ASP.Net MVC应用程序中将身份验证从个人帐户更改为Windows(Intranet) - Changing Authentication from individual accounts to Windows (Intranet) in ASP.Net MVC app ASP.NET MVC 4:身份验证和授权:Intranet应用程序 - ASP.NET MVC 4 : Authentication and Authorization:Intranet Application 如何使用基本身份验证来访问从Windows服务使用Windows身份验证的Asp.Net MVC 4 Intranet Web API方法? - How to use Basic Authentication to access Asp.Net MVC 4 Intranet Web API method which uses Windows Authentication from a Windows Service? ASP.NET MVC中的身份cookie身份验证 - Identity cookie authentication in ASP.NET MVC 使用 Windows 身份验证的 ASP.NET Core 标识 - ASP.NET Core Identity with Windows Authentication 在没有身份验证的情况下创建项目时的ASP.NET Identity Integration - ASP.NET Identity Integration when project is created with no authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM