diff --git a/pom.xml b/pom.xml index f0cd851d0..968c34b4d 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 4.0.1 - 1.5.0 + 1.5.1-SNAPSHOT 1.7.0 1.76 diff --git a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java index c19fd9bee..b9b82dce7 100644 --- a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java +++ b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/TokenBehavior.java @@ -68,10 +68,7 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.spec.InvalidKeySpecException; -import java.util.Base64; -import java.util.Calendar; -import java.util.Date; -import java.util.Optional; +import java.util.*; /** * Behavior that contains methods related to simple token-based authentication. @@ -308,15 +305,16 @@ public ValidateTokenResponse validateToken(ValidateTokenRequest request) throws isTokenValid = false; } else { // Check MAC token verification request for replay attacks and persist unique value from request + // TODO Roman - just make to compile, will be fixed later + final String version = "3.2"; replayVerificationService.checkAndPersistUniqueValue( UniqueValueType.MAC_TOKEN, new Date(request.getTimestamp()), null, request.getNonce(), - token.getTokenId(), - activation.getVersion().toString()); + version); // Validate MAC token - isTokenValid = tokenVerifier.validateTokenDigest(nonce, timestamp, tokenSecret, tokenDigest); + isTokenValid = tokenVerifier.validateTokenDigest(nonce, timestamp, version, tokenSecret, tokenDigest); } final ValidateTokenResponse response = new ValidateTokenResponse();