【问题标题】:office 365 sso saml dot net web application integrationoffice 365 sso saml dot net web 应用程序集成
【发布时间】:2024-04-29 06:50:02
【问题描述】:

office 365 是否提供 SSO SAML?

要求:我有一个来自 我的 Web 应用程序的 asp.net Web 应用程序,我需要登录我的 Office 365 帐户 (SSO),它应该再次登录重定向回我的网络应用程序。

可以用office 365做吗?

【问题讨论】:

    标签: single-sign-on office365 saml


    【解决方案1】:

    如果您想将 Web 应用登录和注销与 Azure AD 集成,我们可以使用 OWIN 身份验证管道,代码如下:

    public void ConfigureAuth(IAppBuilder app)
    {
        app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
    
        app.UseCookieAuthentication(new CookieAuthenticationOptions());
    
        app.UseOpenIdConnectAuthentication(
        new OpenIdConnectAuthenticationOptions
        {
            ClientId = clientId,
            Authority = authority,
            PostLogoutRedirectUri = postLogoutRedirectUri,
        });
    }
    

    我们需要向 Azure AD 注册应用程序以获取客户端 ID。更多详情可以参考here

    【讨论】: