diff --git a/src/main/java/com/uid2/client/BidstreamClient.java b/src/main/java/com/uid2/client/BidstreamClient.java index 399cfd6..6642368 100644 --- a/src/main/java/com/uid2/client/BidstreamClient.java +++ b/src/main/java/com/uid2/client/BidstreamClient.java @@ -13,7 +13,7 @@ public DecryptionResponse decryptTokenIntoRawUid(String token, String domainOrAp return tokenHelper.decrypt(token, Instant.now(), domainOrAppNameFromBidRequest, ClientType.BIDSTREAM); } - DecryptionResponse decryptTokenIntoRawUid(String token, String domainOrAppNameFromBidRequest, Instant now) { + public DecryptionResponse decryptTokenIntoRawUid(String token, String domainOrAppNameFromBidRequest, Instant now) { return tokenHelper.decrypt(token, now, domainOrAppNameFromBidRequest, ClientType.BIDSTREAM); } diff --git a/src/main/java/com/uid2/client/DecryptionStatus.java b/src/main/java/com/uid2/client/DecryptionStatus.java index 4f45b00..3e7747a 100644 --- a/src/main/java/com/uid2/client/DecryptionStatus.java +++ b/src/main/java/com/uid2/client/DecryptionStatus.java @@ -49,7 +49,7 @@ public enum DecryptionStatus { */ INVALID_TOKEN_LIFETIME, /** - * DOMAIN_OR_APP_NAME_CHECK_FAILED: The supplied domain name or app name doesn't match with the allowed names of the participant who generated this token + * DOMAIN_OR_APP_NAME_CHECK_FAILED: The supplied domain name or app name doesn't match with the allowed names of the site/app where this token was generated */ DOMAIN_OR_APP_NAME_CHECK_FAILED } diff --git a/src/test/java/com/uid2/client/BidstreamClientTests.java b/src/test/java/com/uid2/client/BidstreamClientTests.java index ac01e5d..a378b9a 100644 --- a/src/test/java/com/uid2/client/BidstreamClientTests.java +++ b/src/test/java/com/uid2/client/BidstreamClientTests.java @@ -389,6 +389,13 @@ public void tokenExpiryAndCustomNow() throws Exception { res = bidstreamClient.decryptTokenIntoRawUid(advertisingToken, null, expiry.minus(1, ChronoUnit.SECONDS)); assertEquals(EXAMPLE_UID, res.getUid()); + + // case when domain / app name is present + int privacyBits = PrivacyBitsBuilder.Builder().WithClientSideGenerated(true).Build(); + String cstgAdvertisingToken = AdvertisingTokenBuilder.builder().withExpiry(expiry).withGenerated(generated) + .withPrivacyBits(privacyBits).build(); + res = bidstreamClient.decryptTokenIntoRawUid(cstgAdvertisingToken, "example.com", expiry.minus(1, ChronoUnit.SECONDS)); + assertTrue(res.isSuccess()); } @ParameterizedTest