我正在尝试以编程方式生成包含在microsoft.identityModel配置中的以下配置。
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="false" requireHttps="true" issuer="https://IssuedByFoo.com" realm="http://Foo.com/" />
<cookieHandler requireSsl="true" path="/" />
</federatedAuthentication>
到目前为止,我还没有成功配置它。 我尝试在application_Start中设置以下内容,但是当我尝试联合时,会收到错误消息:
"ID5002:FederatedPassiveSignIn控件上的Issuer属性必须设置为可以处理WS-Federation被动协议消息的STS终结点的地址。"
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 = "/";
我非常确定自己没有正确地配置联合身份验证(FederatedAuthentication),也不知道在哪里可以正确地进行配置。我发现的一个问题是,当我在开始请求时设置断点并检查FederatedAuthentication.WSFederationAuthenticationModule时,如果web.config中没有这些属性的值,那么就不会看到设置在它上面的属性。