Beispiel #1
0
 private void Authenticate(bool withCache)
 {
     if (withCache)
     {
         var request = new AuthAuthenticateWithCacheRequest
         {
             instance              = Instance,
             password              = Password,
             remember_me           = false,
             timeZoneOffsetMinutes = (int)TimeZoneInfo.Local.GetUtcOffset(DateTime.Now).TotalMinutes,
             username              = Username,
         };
         var authResponse = authController.AuthenticateWithCache(request);
         if (authResponse == null || authResponse.ResultCode != eResultCodes.conWS_Success)
         {
             throw new Exception("Failed to AuthenticateWithCache: " + authResponse == null ? "" : authResponse.ErrorMessage.ToString());
         }
         else
         {
             Cache = authResponse;
         }
     }
     else
     {
         var request = new AuthAuthenticateRequest
         {
             instance              = Instance,
             password              = Password,
             remember_me           = false,
             timeZoneOffsetMinutes = (int)TimeZoneInfo.Local.GetUtcOffset(DateTime.Now).TotalMinutes,
             username              = Username,
         };
         var authResponse = authController.Authenticate(request);
         if (authResponse == null || authResponse.ResultCode != eResultCodes.conWS_Success)
         {
             throw new Exception("Failed to Authenticate: " + authResponse == null ? "" : authResponse.ErrorMessage.ToString());
         }
     }
 }
 public AuthAuthenticateResponse Authenticate(AuthAuthenticateRequest request)
 {
     return(process <AuthAuthenticateResponse>("Authenticate", request));
 }
 private void Authenticate(bool withCache)
 {
     if (withCache)
       {
     var request = new AuthAuthenticateWithCacheRequest
     {
       instance = Instance,
       password = Password,
       remember_me = false,
       timeZoneOffsetMinutes = (int)TimeZoneInfo.Local.GetUtcOffset(DateTime.Now).TotalMinutes,
       username = Username,
     };
     var authResponse = authController.AuthenticateWithCache(request);
     if (authResponse == null || authResponse.ResultCode != eResultCodes.conWS_Success)
     {
       throw new Exception("Failed to AuthenticateWithCache: " + authResponse == null ? "" : authResponse.ErrorMessage.ToString());
     }
     else
     {
       Cache = authResponse;
     }
       }
       else
       {
     var request = new AuthAuthenticateRequest
     {
       instance = Instance,
       password = Password,
       remember_me = false,
       timeZoneOffsetMinutes = (int)TimeZoneInfo.Local.GetUtcOffset(DateTime.Now).TotalMinutes,
       username = Username,
     };
     var authResponse = authController.Authenticate(request);
     if (authResponse == null || authResponse.ResultCode != eResultCodes.conWS_Success)
     {
       throw new Exception("Failed to Authenticate: " + authResponse == null ? "" : authResponse.ErrorMessage.ToString());
     }
       }
 }