Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eraffel-MDSol committed Mar 22, 2023
1 parent 9ac0976 commit bf7b848
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Medidata.MAuth.Core/MAuthAuthenticator.cs
Expand Up @@ -128,7 +128,18 @@ private bool IsSignatureTimeValid(DateTimeOffset signedTime)
var now = _dateTimeOffsetWrapper.GetUtcNow();
var lowerBound = now - AllowedDriftTimeSpan;
var upperBound = now + AllowedDriftTimeSpan;
return signedTime >= lowerBound && signedTime <= upperBound;
var isValid = signedTime >= lowerBound && signedTime <= upperBound;

if (!isValid)
{
_logger.LogInformation(
"Time verification failed. {signedTime} is not within {AllowedDriftSeconds} seconds of #{now}",
signedTime,
AllowedDriftSeconds,
now);
}

return isValid;
}

private async Task<CacheResult<ApplicationInfo>> SendApplicationInfoRequest(Guid applicationUuid)
Expand Down

0 comments on commit bf7b848

Please sign in to comment.