在asp.net应用程序编程配置federatedAuthentication元素microsoft.identityModel [英] Programatically Configuring federatedAuthentication element in microsoft.identityModel on asp.net application

查看:176
本文介绍了在asp.net应用程序编程配置federatedAuthentication元素microsoft.identityModel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以编程方式生成包含microsoft.identityModel里面配置以下配置。

I am trying to programatically generate the following configuration contained inside the microsoft.identityModel configuration.

<federatedAuthentication>
   <wsFederation passiveRedirectEnabled="false" requireHttps="true" issuer="https://IssuedByFoo.com" realm="http://Foo.com/" />
   <cookieHandler requireSsl="true" path="/" />
</federatedAuthentication>

到目前为止,我一直没能成功地进行配置。我曾尝试设置在的Application_Start下列但是当我试图联合我得到一个错误信息

So far I have not been able to successfully configure this. I have tried setting the following in application_Start but I get an error message when I try to federate

ID5002:在FederatedPassiveSignIn控制发行人属性必须被设置为STS端点能够处理WS联合被动协议消息的地址

"ID5002: The Issuer property on the FederatedPassiveSignIn control must be set to the address of an STS endpoint that can process WS-Federation passive protocol messages."

FederatedAuthentication.WSFederationAuthenticationModule.Realm = "http://Foo.com/";
FederatedAuthentication.WSFederationAuthenticationModule.Issuer = "https://IssuedByFoo.com";
FederatedAuthentication.WSFederationAuthenticationModule.PassiveRedirectEnabled = false;
FederatedAuthentication.WSFederationAuthenticationModule.RequireHttps = true;
FederatedAuthentication.SessionAuthenticationModule.CookieHandler.RequireSsl = true;
FederatedAuthentication.SessionAuthenticationModule.CookieHandler.Path = "/";

我是pretty确定我没有正确配置FederatedAuthentication,我不知道在哪里配置正确。有一件事我注意到的是,当我设置一个断点开始请求,并检查FederatedAuthentication.WSFederationAuthenticationModule我没有看到它设置的属性,当值不是在web.config present

I am pretty sure that I am not configuring FederatedAuthentication correctly, and I am not sure where to configure it correctly. One thing I notice is that when I set a breakpoint on begin request, and inspect the FederatedAuthentication.WSFederationAuthenticationModule I do not see the properties set on it when the values are not present in the web.config

推荐答案

我结束了这个打算。

<一个href=\"http://stackoverflow.com/questions/9473188/is-it-possible-to-get-acs-claims-without-editing-web-config\">Is有可能得到ACS没有编辑的web.config声称?

这似乎工作,我们已经usign自定义模块,因此很容易实现。

This seems to work, and we were already usign a custom Module so it was easy to implement

这篇关于在asp.net应用程序编程配置federatedAuthentication元素microsoft.identityModel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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