@@ -86,17 +86,13 @@ public bool LoginRequest(string username, string password, string realm, string
8686 loginData . Add ( "password" , password ) ;
8787 loginData . Add ( "realm" , realm ) ;
8888
89- if ( otp != null )
90- {
91- loginData . Add ( "otp" , otp ) ;
92- }
93-
9489 // Serialize the object to JSON
9590 var jsonContent = JsonConvert . SerializeObject ( loginData ) ;
9691 var httpContent = new StringContent ( jsonContent , Encoding . UTF8 , "application/json" ) ;
9792
9893 // Attempt Ticket Request
9994 var response = _httpClient . PostAsync ( "access/ticket" , httpContent ) . GetAwaiter ( ) . GetResult ( ) ;
95+ Program . DebugPoint ( "Program Error (Login Request): " + Environment . NewLine + JsonConvert . SerializeObject ( response ) ) ;
10096
10197 // Process If Successful
10298 if ( response . IsSuccessStatusCode )
@@ -155,10 +151,13 @@ private bool TotpChallengeRequest(string otpCode)
155151 var httpContent = new StringContent ( jsonContent , Encoding . UTF8 , "application/json" ) ;
156152 var response = _httpClient . PostAsync ( "access/ticket" , httpContent ) . GetAwaiter ( ) . GetResult ( ) ;
157153
158- Console . WriteLine ( JsonConvert . SerializeObject ( response . Content ) ) ;
154+ Program . DebugPoint ( "Program Error (TOTPChallengeRequest): " + Environment . NewLine + JsonConvert . SerializeObject ( response ) ) ;
155+
159156 if ( response . IsSuccessStatusCode )
160157 {
161- dynamic apiResponse = JsonConvert . DeserializeObject ( response . Content . ReadAsStringAsync ( ) . GetAwaiter ( ) . GetResult ( ) ) ;
158+ string responseData = response . Content . ReadAsStringAsync ( ) . GetAwaiter ( ) . GetResult ( ) ;
159+ dynamic apiResponse = JsonConvert . DeserializeObject ( responseData ) ;
160+
162161 DataTicket = new DataTicket
163162 {
164163 ticket = apiResponse ! . data . ticket ,
0 commit comments