locked
Odd error - access method 'System.Security.Cryptography.RSAPKCS1SHA1SignatureDescription..ctor()' failed for InfoCard

    Pertanyaan

  • Hi all,

    I am using the DotNetOpenAuth framework as a wrapper for Infocard. When creating a token, it seems to blow up with a wierd contructor error all the way down in the framework.

    I have an MVC3/Razor View that creates an info card

    <object type="application/x-informationcard" name="xmlToken">
    <param name="tokenType" value="urn:oasis:names:tc:SAML:1.0:assertion" />
    <param name="issuer"
            value="http://schemas.xmlsoap.org/ws/2005/05/identity/issuer/self" />
    <param name="requiredClaims"
            value="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
                http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname
                http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
                http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" />
    </object>

    This calls back to a method that calls this code..

                string xmlToken = this.HttpContext.Request.Params["xmlToken"];
                Token token = Token.Read(xmlToken);

    Then when the Token is initialized this error is thrown...

    Server Error in '/OrchardLocal' Application.
    --------------------------------------------------------------------------------

    Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)' to access method 'System.Security.Cryptography.RSAPKCS1SHA1SignatureDescription..ctor()' failed.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.MethodAccessException: Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)' to access method 'System.Security.Cryptography.RSAPKCS1SHA1SignatureDescription..ctor()' failed.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

    Stack Trace:


    [MethodAccessException: Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)' to access method 'System.Security.Cryptography.RSAPKCS1SHA1SignatureDescription..ctor()' failed.]
       lambda_method(Closure ) +55
       System.IdentityModel.CryptoHelper.GetAlgorithmFromConfig(String algorithm) +584
       System.IdentityModel.Tokens.RsaSecurityKey.GetHashAlgorithmForSignature(String algorithm) +45
       System.IdentityModel.SignedXml.StartSignatureVerification(SecurityKey verificationKey) +324
       System.IdentityModel.Tokens.SamlAssertion.VerifySignature(SignedXml signature, SecurityKey signatureVerificationKey) +35
       System.IdentityModel.Tokens.SamlAssertion.ReadXml(XmlDictionaryReader reader, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver) +1082
       System.IdentityModel.Tokens.SamlSerializer.LoadAssertion(XmlDictionaryReader reader, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver) +55
       System.IdentityModel.Tokens.SamlSerializer.ReadToken(XmlReader reader, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver) +64
       System.ServiceModel.Security.SamlTokenEntry.ReadTokenCore(XmlDictionaryReader reader, SecurityTokenResolver tokenResolver) +22
       System.ServiceModel.Security.WSSecurityTokenSerializer.ReadTokenCore(XmlReader reader, SecurityTokenResolver tokenResolver) +140
       System.IdentityModel.Selectors.SecurityTokenSerializer.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) +22
       DotNetOpenAuth.InfoCard.TokenUtility.AuthenticateToken(XmlReader reader, Uri audience) +112
       DotNetOpenAuth.InfoCard.Token..ctor(String tokenXml, Uri audience, TokenDecryptor decryptor) +666
       DotNetOpenAuth.InfoCard.Token.Read(String tokenXml, Uri audience, IEnumerable`1 decryptionTokens) +213
       DotNetOpenAuth.InfoCard.Token.Read(String tokenXml, Uri audience) +110
       DotNetOpenAuth.InfoCard.Token.Read(String tokenXml) +79
       NGM.OpenAuthentication.Controllers.CardSpaceAccountController.LogOn(String returnUrl) +138
       lambda_method(Closure , ControllerBase , Object[] ) +140
       System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
       System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
       System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
       System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
       System.Web.Mvc.Controller.ExecuteCore() +116
       System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
       System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
       System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
       System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
       System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
       System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
       System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) +55
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841105
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

     


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

     

    This is NOT done over HTTPS.. just regular HTTP...

     

    I have spoken to the guy who writes DotNetOpenAuth and he said to ask here.

    Cheers, Nick


    Blog - http://www.themayneissue.com Twit - http://twitter.com/NicholasMayne Facebook - http://www.facebook.com/nick.mayne
    • Diedit oleh Nick Mayne 16 Februari 2011 10:10 more detail
    16 Februari 2011 10:07