Windows Azure Active Directory 单点登录 ASP.NET

Windows azure active directory single sign on with ASP.NET

我有多个应用程序是使用 ASP.NET 开发的,所有应用程序都使用默认安全模块以便更清楚每个应用程序都有自己的数据库,其中包含一个 table 用户和登录名使用此 table 授权用户 "username & password" 的页面,所有应用程序都部署在同一域下。 目前我们正在努力将 SSO 解决方案应用到所有应用程序中。我正在研究一种无需更改即可应用它并修改当前应用程序安全模块的好方法。我发现 Windows azure 活动目录单点登录 需要每个用户都有活动目录帐户。问题是。

1- 知道应用程序是使用不同版本(ASP.NET 2008、2010 等...)开发的,应该在我的应用程序中应用哪些更改才能使用 SSO?

2- 我想我们必须在当前用户 table 与 Active Directory 用户帐户之间进行某种映射,对吗?

3- 是否会对当前登录屏幕进行任何更改?

谢谢。

1- What the changes that should be applied in my applications to use the SSO knowing that the applications are developed with different version (ASP.NET 2008 , 2010 , etc...) ?

据我所知,该身份支持owin登录。如果您的应用程序使用身份,那么您可以使用 OpenID Connect 从单个 Azure Active Directory 租户登录用户,使用 ASP.Net OpenID Connect OWIN 中间件。

使用登录成功后,身份会自动将用户信息填入User.Identity.Claims。

如果用户访问第二个应用,应用会根据客户端cookie自动发送请求从AD获取用户信息。这会启用 SSO。

但是如果你使用会员,会员不支持owin登录。所以如果你想使用azure AD登录,我建议你可以增加应用程序.net框架版本并使用身份。

更多关于如何启用azure AD登录的详细信息,您可以参考这个article

I thing we have to do some kind of mapping between the current users table with the active directory user account, is that right ?

这是根据您的要求。使用Azure AD账号登录后,可以使用以下代码获取用户信息。然后你可以映射用户或其他东西。

[Authorize]
public ActionResult SomeAction()
{
    var identity = (ClaimsIdentity)User.Identity;
    IEnumerable<Claim> claims = identity.Claims;
    ...
}

3- is there any changes that will be made on the current login screen ?

您可以在登录页面启用一个按钮,将用户重定向到 azure AD 登录页面。

更多细节,你可以参考这个code sample