令牌解析程序无法解析安全密钥引用

时间:2015-06-23 08:18:04

标签: c# wcf wif

我在我的项目中使用Windows身份识别基础。我在我的应用程序中使用了两个证书。一个是STS证书,另一个是WCF服务项目。

我正在使用SimpleWebTokenHandler作为令牌。 但是this.Configuration.IssuerTokenResolver.ResolveSecurityKey(子句)抛出错误:令牌解析器无法解析安全密钥引用

Stack Trace如下:

  

[SecurityTokenValidationException:对称密钥问题。错误是   令牌解析程序无法解析安全密钥引用   ' NRWA.Business.Token.SimpleWebTokenKeyIdentifierClause&#39 ;.]
  NRWA.Business.Token.SimpleWebTokenHandler.WriteToken(XmlWriter writer,   SecurityToken令牌)   E:\项目\ NRWA \源码\ NRWA \ WebApplication的\ NRWA.Business \令牌\​​ SimpleWebTokenHandler.cs:410   Microsoft.IdentityModel.Tokens.SecurityTokenSerializerAdapter.WriteTokenCore(XmlWriter的   作家,SecurityToken令牌)+407
  Microsoft.IdentityModel.Protocols.WSTrust.WSTrustSerializationHelper.WriteRSTRXml(XmlWriter的   writer,String elementName,Object elementValue,   WSTrustSerializationContext上下文,WSTrustConstantsAdapter   trustConstants)+791
  Microsoft.IdentityModel.Protocols.WSTrust.WSTrustSerializationHelper.WriteKnownResponseElement(RequestSecurityTokenResponse   rstr,XmlWriter writer,WSTrustSerializationContext context,   WSTrustResponseSerializer responseSerializer,WSTrustConstantsAdapter   trustConstants)+450
  Microsoft.IdentityModel.Protocols.WSTrust.WSTrust13ResponseSerializer.WriteKnownResponseElement(RequestSecurityTokenResponse   rstr,XmlWriter writer,WSTrustSerializationContext context)+179
  Microsoft.IdentityModel.Protocols.WSTrust.WSTrustSerializationHelper.WriteResponse(RequestSecurityTokenResponse   响应,XmlWriter编写器,WSTrustSerializationContext上下文,   WSTrustResponseSerializer responseSerializer,WSTrustConstantsAdapter   trustConstants)+344
  Microsoft.IdentityModel.Protocols.WSTrust.WSTrust13ResponseSerializer.WriteXml(RequestSecurityTokenResponse   响应,XmlWriter编写器,WSTrustSerializationContext上下文)+243   Microsoft.IdentityModel.Protocols.WSFederation.WSFederationSerializer.GetResponseAsString(RequestSecurityTokenResponse   response,WSTrustSerializationContext context)+227
  Microsoft.IdentityModel.Protocols.WSFederation.SignInResponseMessage..ctor(URI   baseUrl,RequestSecurityTokenResponse响应,WSFederationSerializer   federationSerializer,WSTrustSerializationContext context)+101
  Microsoft.IdentityModel.Web.FederatedPassiveSecurityTokenServiceOperations.ProcessSignInRequest(SignInRequestMessage   requestMessage,IPrincipal principal,SecurityTokenService sts,   WSFederationSerializer federationSerializer)+375
  Microsoft.IdentityModel.Web.FederatedPassiveSecurityTokenServiceOperations.ProcessRequest(HttpRequest的   请求,IPrincipal principal,SecurityTokenService sts,HttpResponse   响应,WSFederationSerializer federationSerializer)+1435
  Microsoft.IdentityModel.Web.FederatedPassiveSecurityTokenServiceOperations.ProcessRequest(HttpRequest的   请求,IPrincipal principal,SecurityTokenService sts,HttpResponse   响应)+18 PassiveSTS._Default.Page_PreRender(对象发送者,   EventArgs e)in   E:\项目\ NRWA \源码\ NRWA \ WebApplication的\ NRWA.STS \ Default.aspx.cs:30   System.Web.UI.Control.PreRenderRecursiveInternal()+ 113 3   System.Web.UI.Page.ProcessRequestMain(布尔   includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)   4297

0 个答案:

没有答案