Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/mRemoteNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortecxx <tecxx@rrs.at>2022-04-19 12:44:12 +0300
committertecxx <tecxx@rrs.at>2022-04-19 12:44:12 +0300
commit27803e7787e8e94cd946442fca94ac13acb893ee (patch)
tree215b22f1c1073bc0732f46350eeea505c3145591
parent58f9c1575f4cbcf492c541d3fc050f0f9e9f02fa (diff)
fix for otp token renewal in TSS api
-rw-r--r--ExternalConnectors/TSS/SecretServerInterface.cs17
-rw-r--r--mRemoteNG/Language/Language.resx2
2 files changed, 14 insertions, 5 deletions
diff --git a/ExternalConnectors/TSS/SecretServerInterface.cs b/ExternalConnectors/TSS/SecretServerInterface.cs
index 4a1b2c35..5129e488 100644
--- a/ExternalConnectors/TSS/SecretServerInterface.cs
+++ b/ExternalConnectors/TSS/SecretServerInterface.cs
@@ -194,15 +194,24 @@ namespace ExternalConnectors.TSS
}
catch (Exception)
{
- // refresh token failed. maybe the refresh time is over? try to fetch a fresh one.
- // if OTP is used we need to ask user for a new OTP
+ // refresh token failed. clean memory and start fresh
+ SSConnectionData.ssTokenBearer = "";
+ SSConnectionData.ssTokenRefresh = "";
+ SSConnectionData.ssTokenExpiresOn = DateTime.Now;
+ // if OTP is required we need to ask user for a new OTP
if (!String.IsNullOrEmpty(SSConnectionData.ssOTP))
{
SSConnectionData.initdone = false;
+ // the call below executes a connection test, which fetches a valid token
SSConnectionData.Init();
+ // we now have a fresh token in memory. return it to caller
+ return SSConnectionData.ssTokenBearer;
+ }
+ else
+ {
+ // no user interaction required. get a fresh token and return it to caller
+ return GetTokenFresh();
}
- // get a fresh token
- return GetTokenFresh();
}
}
}
diff --git a/mRemoteNG/Language/Language.resx b/mRemoteNG/Language/Language.resx
index bf6d29e0..80465f73 100644
--- a/mRemoteNG/Language/Language.resx
+++ b/mRemoteNG/Language/Language.resx
@@ -1091,7 +1091,7 @@ If you run into such an error, please create a new connection file!</value>
<value>Use restricted admin mode on the target host (local system context).</value>
</data>
- <data name="PropertyDescriptionUseRemoteCredentialGuard" xml:space="preserve">
+ <data name="PropertyDescriptionUseRCG" xml:space="preserve">
<value>Use Remote Credential Guard to tunnel authentication on target back to source through the RDP channel.</value>
</data>