diff --git a/src/Medidata.MAuth.Core/MAuthAuthenticator.cs b/src/Medidata.MAuth.Core/MAuthAuthenticator.cs index f55f65f..200fab4 100644 --- a/src/Medidata.MAuth.Core/MAuthAuthenticator.cs +++ b/src/Medidata.MAuth.Core/MAuthAuthenticator.cs @@ -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> SendApplicationInfoRequest(Guid applicationUuid)