X509 certificate not loading private key file on server
I'm using the Google Analytics API and I followed this SO question to set up the OAuth: https://stackoverflow.com/a/13013265/1299363 Here is my OAuth code: public void SetupOAuth () { var Cert = new X509Certificate2( PrivateKeyPath, "notasecret", X509KeyStorageFlags.Exportable); var Provider = new AssertionFlowClient(GoogleAuthenticationServer.Description, Cert) { ServiceAccountId = ServiceAccountUser, Scope = ApiUrl + "analytics.readonly" }; var Auth = new OAuth2Authenticator<AssertionFlowClient>(Provider, AssertionFlowClient.GetState); Service = new AnalyticsService(Auth); } PrivateKeyPath