2015-09-28 104 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 
     }) 
    }); 
相關問題