2015-09-28 61 views
0

我正在开发一个应用程序,它使用Facebook和Twitter登录作为注册帐户的方式之一,前几天它突然停止工作。 它使用OAuth作为身份验证方法。 我检查了钥匙,他们没有改变,有没有人有过这方面的经验? 我现在得到这个错误:Twitter登录 - 根据验证程序,远程证书无效

The remote certificate is invalid according to the validation procedure. 

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.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. 
+0

Quote:_“请查看堆栈跟踪以获取有关该错误的更多信息以及源代码的位置。”_ – CBroe

回答

0

张贴没有足够的信息张贴道歉。 但我已经回顾了堆栈跟踪以及从twitters API调用Token和TokenSecret的方法,该标记实际上为空。一旦我通过指向令牌位置来解决这个问题,它就解决了这个问题。

0

默认代码片段。

enter image description here

与Startup.Auth.cs类下面给出的一个只需更换上面的代码片断和替换自己的使用者密钥和秘密。

app.UseTwitterAuthentication(new TwitterAuthenticationOptions 
    { 
     ConsumerKey = "XXXXXXXXXXXXXXXXXXXXXX", 
     ConsumerSecret = " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ", 
     BackchannelCertificateValidator = new Microsoft.Owin.Security.CertificateSubjectKeyIdentifierValidator(new[] 
     { 

      "A5EF0B11CEC04103A34A659048B21CE0572D7D47", // VeriSign Class 3 Secure Server CA - G2 
      "0D445C165344C1827E1D20AB25F40163D8BE79A5", // VeriSign Class 3 Secure Server CA - G3 
      "7FD365A7C2DDECBBF03009F34339FA02AF333133", // VeriSign Class 3 Public Primary CA - G5 
      "39A55D933676616E73A761DFA16A7E59CDE66FAD", // Symantec Class 3 Secure Server CA - G4 
      "‎add53f6680fe66e383cbac3e60922e3b4c412bed", // Symantec Class 3 EV SSL CA - G3 
      "4eb6d578499b1ccf5f581ead56be3d9b6744a5e5", // VeriSign Class 3 Primary CA - G5 
      "5168FF90AF0207753CCCD9656462A212B859723B", // DigiCert SHA2 High Assurance Server C‎A 
      "B13EC36903F8BF4701D498261A0802EF63642BC3" // DigiCert High Assurance EV Root CA 
     }) 
    }); 
相关问题