Example #1
0
 public void Authenticate()
 {
     if (_source.ApiToken == null || DateTime.Compare(_source.TokenExpiryDate, DateTime.Now) <= 0)
     {
         var authorisationResponse = AuthenicateWithApi();
         UpdateDatabase(authorisationResponse);
     }
     _client.AddDefaultHeader("Authorization", _source.ApiToken);
 }