我使用服务创建了Web App,以便使用WS-Trust协议为某些Silverlight应用程序接收声明。 我看到声明是在GetOutputClaimsIdentity()方法中创建的(调用两次 - 为什么?),但在Silverligh级别我收到“Not Found”消息(空流?)。
Silverlight对WS-Trust的支持我从最新的WIF培训套件中获取。我试图在服务器端调试代码, 但遗憾的是,WIF源代码尚未作为.NET Framework调试的一部分提供:(
所以我不知道为什么它没有正确地回复声明客户端应用程序的响应。
WS-Trust项目的Web.config文件的内容如下(我目前使用自签名证书):
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<appSettings>
<add key="IssuerName" value="PatientInfo"/>
<add key="SigningCertificateName" value="CN=PatientInfo"/>
<!--<add key="EncryptingCertificateName" value="CN=DefaultApplicationCertificate"/>-->
<add key="EncryptingCertificateName" value=""/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0" >
<assemblies>
<add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="None"/>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment
aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<ws2007HttpBinding>
<binding name="ws2007HttpBindingConfiguration">
<security mode="TransportWithMessageCredential">
<message establishSecurityContext="false" clientCredentialType="UserName" />
</security>
</binding>
</ws2007HttpBinding>
</bindings>
<services>
<service name="Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract" behaviorConfiguration="ServiceBehavior">
<endpoint address="IWSTrust13"
binding="ws2007HttpBinding"
bindingConfiguration="ws2007HttpBindingConfiguration"
contract="Microsoft.IdentityModel.Protocols.WSTrust.IWSTrust13SyncContract"/>
<host>
<baseAddresses>
<add baseAddress="https://WIN-8LUMNJ5E6S4/PatientHistInfo.WS-Trust/InternalAuthentication.svc" />
</baseAddresses>
</host>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
<microsoft.identityModel>
<service>
<securityTokenHandlers>
<remove type="Microsoft.IdentityModel.Tokens.WindowsUserNameSecurityTokenHandler, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add type="eSoft.Server.Security.CustomUserNamePasswordTokenHandler, PatientHistInfo.WS-Trust"/>
</securityTokenHandlers>
</service>
</microsoft.identityModel>
<system.diagnostics>
<sources>
<source name="Microsoft.IdentityModel" switchValue="Verbose">
<listeners>
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="WIFTrace.txt" />
</listeners>
</source>
</sources>
<trace autoflush="true" />
</system.diagnostics>
</configuration>
Fiddler结果如下:
HTTP / 1.1 504 Fiddler - 接收失败 内容类型:text / html 连接:关闭 时间戳:15:41:21.666
ReadResponse()失败:服务器未返回此请求的响应。
导致此类问题的原因是什么?