C# ASP.NET MVC OWIN and Twitter authentication error

We have an MVC project using OWIN Framework to allow our users to authenticate using Twitter.
However starting today, we have been getting this exception when trying to authenticate:

System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

Thanks to the power of open source we can see that the thumbprints for the twitter certificates have been coded in the Katana Project.


Recently some certificates must have changed and now the thumbprints no longer match.

Please add a new thumb print for the "VeriSign Class 3 Public Primary Certification Authority – G5" Certificate to your Twitter Auth Options in your Startup.Auth.cs (for MVC users).

Change from the default:

    consumerKey: "XXXX",
    consumerSecret: "XXX"


app.UseTwitterAuthentication(new TwitterAuthenticationOptions
    ConsumerKey = "XXXX",
    ConsumerSecret = "XXXX",
    BackchannelCertificateValidator = 
      new Microsoft.Owin.Security.CertificateSubjectKeyIdentifierValidator(
        new[] {
        // VeriSign Class 3 Secure Server CA - G2
        // VeriSign Class 3 Secure Server CA - G3
        // VeriSign Class 3 Public Primary Certification Authority - G5
        // Symantec Class 3 Secure Server CA - G4
        // Symantec Class 3 EV SSL CA - G3
        // VeriSign Class 3 Primary CA - G5
        // DigiCert SHA2 High Assurance Server C‎A 
        // DigiCert High Assurance EV Root CA 

Happy coding!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.