使用OWIN WS-包装联合会反对ADFS 3.0认证 [英] Use OWIN Ws-Federation package to authenticate against ADFS 3.0

查看:299
本文介绍了使用OWIN WS-包装联合会反对ADFS 3.0认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要用AD帐户进行身份验证MVC的内部网站上。我安装ADFS 3.0(赢服务器2012 R2),随后<一个href=\"http://www.cloudidentity.com/blog/2014/02/12/use-the-on-$p$pmises-organizational-authentication-option-adfs-with-asp-net-in-visual-studio-2013/\">this来设置ADFS信赖方信任。 <一href=\"http://www.cloudidentity.com/blog/2014/02/20/ws-federation-in-microsoft-owin-componentsa-quick-start/\">This其他邮政推出了WS-联合会OWIN成分,我想使用它。它提到如何连接到有关ADFS的Azure的广告,但一无所获。我试着在设置配置属性MetadataAddress和Wtrealm匹配我在ADFS配置,但在运行时我得到一个错误:

I have an MVC intranet site that needs to use AD accounts for authentication. I setup ADFS 3.0 (Win Server 2012 R2) and followed this to setup the ADFS Relying Party Trust. This other post introduces the Ws-Federation OWIN components and I'd like to use it. It mentions how to connect to an Azure AD but nothing regarding ADFS. I tried setting the configuration properties "MetadataAddress" and "Wtrealm" to match what I configured in ADFS but at runtime I get an error:

A default value for SignInAsAuthenticationType was not found in IAppBuilder Properties. This can happen if your authentication middleware are added in the wrong order, or if one is missing.

任何意见或样品code展示了如何做到这一点?

Any ideas or sample code showing how to do this?

推荐答案

是啊..我碰到了同样的问题。只要做到以下,它应该工作:

Yeah.. I came across the same issue. Just do the following and it should work:

    app.SetDefaultSignInAsAuthenticationType(WsFederationAuthenticationDefaults.AuthenticationType );

    app.UseCookieAuthentication(new CookieAuthenticationOptions
    {
       AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType
    });

这篇关于使用OWIN WS-包装联合会反对ADFS 3.0认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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