From 3fd79e79f5a150b536cd1d44a50f525929cd535f Mon Sep 17 00:00:00 2001 From: liga-oz Date: Fri, 21 Jul 2023 16:03:02 +0200 Subject: [PATCH] replace deprecated method with getAppTid --- .../validation/validators/JwtSignatureValidator.java | 8 ++++---- .../validators/OAuth2TokenKeyServiceWithCache.java | 4 ++-- .../security/xsuaa/client/OAuth2TokenKeyService.java | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/JwtSignatureValidator.java b/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/JwtSignatureValidator.java index a408c3f5e..e6fe0ff20 100644 --- a/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/JwtSignatureValidator.java +++ b/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/JwtSignatureValidator.java @@ -75,12 +75,12 @@ void disableTenantIdCheck() { public ValidationResult validate(Token token) { String jwksUri; String keyId; - String zoneIdForTokenKeys = null; + String appTidForTokenKeys = null; if (Service.IAS == configuration.getService()) { - zoneIdForTokenKeys = token.getZoneId(); + appTidForTokenKeys = token.getAppTid(); if (isTenantIdCheckEnabled && !token.getIssuer().equals("" + configuration.getUrl()) - && zoneIdForTokenKeys == null) { + && appTidForTokenKeys == null) { return createInvalid("Error occurred during signature validation: OIDC token must provide app_tid."); } } @@ -96,7 +96,7 @@ public ValidationResult validate(Token token) { keyId, jwksUri, fallbackPublicKey, - zoneIdForTokenKeys); + appTidForTokenKeys); } catch (OAuth2ServiceException | IllegalArgumentException e) { return createInvalid("Error occurred during jwks uri determination: {}", e.getMessage()); } diff --git a/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/OAuth2TokenKeyServiceWithCache.java b/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/OAuth2TokenKeyServiceWithCache.java index 588c212cb..20572312d 100644 --- a/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/OAuth2TokenKeyServiceWithCache.java +++ b/java-security/src/main/java/com/sap/cloud/security/token/validation/validators/OAuth2TokenKeyServiceWithCache.java @@ -114,7 +114,7 @@ public OAuth2TokenKeyServiceWithCache withTokenKeyService(OAuth2TokenKeyService * the Token Key Uri (jwks) of the Access Token (can be tenant * specific). * @param appTid - * the tenant identifier of the tenant + * the unique identifier of the tenant * @return a PublicKey * @throws OAuth2ServiceException * in case the call to the jwks endpoint of the identity service @@ -147,7 +147,7 @@ public PublicKey getPublicKey(JwtSignatureAlgorithm keyAlgorithm, String keyId, * the Token Key Uri (jwks) of the Access Token (can be tenant * specific). * @param appTid - * the tenant identifier of the tenant + * the unique identifier of the tenant * * @param clientId * client id from the service configuration diff --git a/token-client/src/main/java/com/sap/cloud/security/xsuaa/client/OAuth2TokenKeyService.java b/token-client/src/main/java/com/sap/cloud/security/xsuaa/client/OAuth2TokenKeyService.java index b744f13dd..d73a1d5a4 100644 --- a/token-client/src/main/java/com/sap/cloud/security/xsuaa/client/OAuth2TokenKeyService.java +++ b/token-client/src/main/java/com/sap/cloud/security/xsuaa/client/OAuth2TokenKeyService.java @@ -21,7 +21,7 @@ public interface OAuth2TokenKeyService { * @param tokenKeysEndpointUri * the token endpoint URI (jku). * @param tenantId - * the tenant id of the tenant. Obligatory parameter in context of + * the unique identifier of the tenant. Obligatory parameter in context of * multi-tenant IAS applications to make sure that the tenant id * belongs to the IAS tenant. * @return list of JSON Web Token (JWT) keys as @@ -37,7 +37,7 @@ public interface OAuth2TokenKeyService { * @param tokenKeysEndpointUri * the token endpoint URI (jku). * @param tenantId - * the tenant id of the tenant. Obligatory parameter in context of + * the unique identifier of the tenant. Obligatory parameter in context of * multi-tenant IAS applications to make sure that the tenant id * belongs to the IAS tenant. * @param clientId