Exemple #1
0
 public void Authenticate()
 {
     PromptCredentials();
     OAuthToken = HttpPost <Token>(Settings.Default.LogonEndpoint, Login);
     if (OAuthToken.MfaRequired)
     {
         Console.Write("MFA Code: ");
         string mfaCode = Console.ReadLine();
         Login.MfaCode = mfaCode;
         OAuthToken    = HttpPost <Token>(Settings.Default.LogonEndpoint, Login);
     }
     OAuthToken.SaveToFile();
     Client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(OAuthToken.TokenType, OAuthToken.AccessToken);
 }