From 020240787b165440ee9f8fb6404883d6e87c133c Mon Sep 17 00:00:00 2001 From: Jeremy Tellier - ROG Date: Tue, 21 Sep 2021 13:51:41 +0100 Subject: [PATCH 1/4] Remove Recovery Code On Enroll, and fix timeout on tick down --- DesktopEdge/MainWindow.xaml.cs | 2 +- DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 37b05c32..907f0a76 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -145,7 +145,7 @@ namespace ZitiDesktopEdge { break; } } - ShowMFARecoveryCodes(found); + // ShowMFARecoveryCodes(found); if (this.IdentityMenu.Identity != null && this.IdentityMenu.Identity.Fingerprint == mfa.Fingerprint) this.IdentityMenu.Identity = found; } else { await ShowBlurbAsync("Provided code could not be verified", ""); diff --git a/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs b/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs index c8b24210..e2482dc1 100644 --- a/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs +++ b/DesktopEdge/Views/ItemRenderers/IdentityItem.xaml.cs @@ -67,11 +67,12 @@ namespace ZitiDesktopEdge { if (info.Timeout>-1) { TimeSpan t = (DateTime.Now - info.TimeUpdated); int timePast = (int)Math.Floor(t.TotalSeconds); + int timeout = info.Timeout - timePast; + logger.Trace("Max: Service " + info.Name + " Updated " + timePast + " seconds ago will timeout in " + timeout + " seconds"); if (timePast > info.Timeout) { available--; + if (info.Timeout > -1) maxto = 0; } else { - int timeout = info.Timeout - timePast; - logger.Trace("Max: Service " + info.Name + " Updated " + timePast + " seconds ago will timeout in " + timeout + " seconds"); if (timeout > -1 && timeout > maxto) maxto = timeout; if (timeout == 0) available--; } From 20c75b3a9c582b068b6cb45f857c8f6126b105ac Mon Sep 17 00:00:00 2001 From: Jeremy Tellier - ROG Date: Tue, 21 Sep 2021 14:05:27 +0100 Subject: [PATCH 2/4] Put it back in on enroll --- DesktopEdge/MainWindow.xaml.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 907f0a76..9f9aa357 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -145,8 +145,8 @@ namespace ZitiDesktopEdge { break; } } - // ShowMFARecoveryCodes(found); if (this.IdentityMenu.Identity != null && this.IdentityMenu.Identity.Fingerprint == mfa.Fingerprint) this.IdentityMenu.Identity = found; + ShowMFARecoveryCodes(found); } else { await ShowBlurbAsync("Provided code could not be verified", ""); } @@ -331,10 +331,8 @@ namespace ZitiDesktopEdge { if (IdentityMenu.IsVisible) { if (isComplete) { if (MFASetup.Type == 2) { - ShowRecovery(IdentityMenu.Identity); } else if (MFASetup.Type == 3) { } else if (MFASetup.Type == 4) { - ShowRecovery(IdentityMenu.Identity); } } IdentityMenu.UpdateView(); From 2c293069ceff2d56d3931b921d9546bbcd8815a9 Mon Sep 17 00:00:00 2001 From: Jeremy Tellier - ROG Date: Tue, 21 Sep 2021 16:16:21 +0100 Subject: [PATCH 3/4] Remove MFA Recovery Code Capture on Mfa --- DesktopEdge/Views/Screens/MFAScreen.xaml.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/DesktopEdge/Views/Screens/MFAScreen.xaml.cs b/DesktopEdge/Views/Screens/MFAScreen.xaml.cs index f752a6d1..83845b84 100644 --- a/DesktopEdge/Views/Screens/MFAScreen.xaml.cs +++ b/DesktopEdge/Views/Screens/MFAScreen.xaml.cs @@ -221,6 +221,15 @@ namespace ZitiDesktopEdge { } } + /// + /// Call the MFA Functions + /// + /// Types: + /// 1 = Normal MFA Authentication + /// 2 = Get Recovery Codes + /// 3 = Remove MFA + /// 4 = Generate New MFA Codes + /// async private void DoAuthenticate() { if (!this._executing) { @@ -236,8 +245,6 @@ namespace ZitiDesktopEdge { this.OnError?.Invoke("Authentication Failed"); this._executing = false; } else { - MfaRecoveryCodesResponse codeResponse = await serviceClient.ReturnMFACodes(this._identity.Fingerprint, code); - this._identity.MFAInfo.RecoveryCodes = codeResponse.Payload; this._identity.MFAInfo.IsAuthenticated = true; this.OnClose?.Invoke(true); this._executing = false; From 0c42bedfb9688d9c5f96b8f3c71970a3f9bf0eee Mon Sep 17 00:00:00 2001 From: Jeremy Tellier - ROG Date: Tue, 21 Sep 2021 16:58:09 +0100 Subject: [PATCH 4/4] Replace the Show Screen --- DesktopEdge/MainWindow.xaml.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 9f9aa357..4aac7e8b 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -331,8 +331,10 @@ namespace ZitiDesktopEdge { if (IdentityMenu.IsVisible) { if (isComplete) { if (MFASetup.Type == 2) { + ShowRecovery(IdentityMenu.Identity); } else if (MFASetup.Type == 3) { } else if (MFASetup.Type == 4) { + ShowRecovery(IdentityMenu.Identity); } } IdentityMenu.UpdateView();