From 1cac2c6ee35a1d7c7d43303cac34d195cfb0c253 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 7 Sep 2023 16:57:29 +0200 Subject: [PATCH] Pass version to validateTokenDigest --- .../app/server/service/behavior/tasks/TokenBehavior.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 f33a1b37b..a66726875 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. @@ -313,8 +310,10 @@ public ValidateTokenResponse validateToken(ValidateTokenRequest request) throws null, request.getNonce(), token.getTokenId()); + // TODO Roman - just make to compile, but activation#version contains only the major version + final String version = Objects.toString(activation.getVersion()); // Validate MAC token - isTokenValid = tokenVerifier.validateTokenDigest(nonce, timestamp, tokenSecret, tokenDigest); + isTokenValid = tokenVerifier.validateTokenDigest(nonce, timestamp, version, tokenSecret, tokenDigest); } final ValidateTokenResponse response = new ValidateTokenResponse();