Skip to content

Commit

Permalink
Pass version to validateTokenDigest
Browse files Browse the repository at this point in the history
  • Loading branch information
banterCZ committed Sep 7, 2023
1 parent bf195ef commit 1cac2c6
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1cac2c6

Please sign in to comment.