简体   繁体   English

ASP.NET与Windows Azure Active Directory SSO

[英]ASP.NET with Windows Azure Active Directory SSO

I already have more than 10 applications developed using ASP.NET. 我已经使用ASP.NET开发了10多个应用程序。 There are different versions for frameworks 2.0, 3.5 and 4. Currently I need to apply single sign on on all of my applications using Windows Azure Active Directory SSO. 框架2.0,3.5和4有不同的版本。目前,我需要在使用Windows Azure Active Directory SSO的所有应用程序上应用单点登录。 But I do not know what the code or library should be added to my application to be configured with the Azure SSO. 但我不知道应该将代码或库添加到我的应用程序中以配置Azure SSO。 Do I need to re-develop my application or recreate it with different versions? 我是否需要重新开发应用程序或使用不同版本重新创建它? Does anyone know what I should do? 有谁知道我应该怎么做?

Different .NET frameworks should not be a problem. 不同的.NET框架应该不是问题。 You should be able to implement SSO for all of these applications, but you will need to add it individually to each one. 您应该能够为所有这些应用程序实现SSO,但是您需要为每个应用程序单独添加它。 You will need to add it in the code of the application itself and then register each application to your tenant. 您需要将其添加到应用程序本身的代码中,然后将每个应用程序注册到您的租户。

Here is a very good tutorial that shows you step by step how to add SSO to a published web application in Azure using OpenID Connect. 这是一个非常好的教程,它将逐步向您展示如何使用OpenID Connect将SSO添加到Azure中的已发布Web应用程序。 You can follow the steps exactly and build their demo version to test it out, or follow their steps at the bottom that show how to implement SSO in your own application. 您可以完全按照步骤操作并构建其演示版本以进行测试,或者按照底部的步骤说明如何在您自己的应用程序中实现SSO。

https://github.com/Azure-Samples/active-directory-dotnet-webapp-openidconnect https://github.com/Azure-Samples/active-directory-dotnet-webapp-openidconnect

Here is the official Microsoft documentation, which also describes how to implement SSO: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-saas-custom-apps 以下是官方的Microsoft文档,其中还介绍了如何实现SSO: https//docs.microsoft.com/en-us/azure/active-directory/active-directory-saas-custom-apps

Alternatively, if you want to use a library that is already integrated with Visual Studio, you can go to Project > Add Connected Service > Authentication with Azure Active Directory. 或者,如果要使用已与Visual Studio集成的库,则可以转到“项目”>“添加连接的服务”>“使用Azure Active Directory进行身份验证”。

The "SSO" in this case refers to SAML . 在这种情况下,“SSO”指的是SAML To do SAML in C#, look into Windows Identity Foundation (WIF), which includes some SAML support. 要在C#中执行SAML,请查看Windows Identity Foundation (WIF),其中包括一些SAML支持。

Note that doing SAML SSO involves more than just dropping in the right kind of username/password field. 请注意,执行SAML SSO不仅仅涉及到正确类型的用户名/密码字段。 You need to have additional special pages to handle certain redirects, and have a way to store exchange saml metadata with your Azure AD identity provider. 您需要有其他特殊页面来处理某些重定向,并且可以使用Azure AD身份提供程序存储交换saml元数据。 It can be painful. 这可能很痛苦。

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

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