From 433100ebf756341357e4cdfd1b248d0aec38a2dd Mon Sep 17 00:00:00 2001 From: piraveena Date: Thu, 20 Jul 2023 09:10:13 +0530 Subject: [PATCH] Use util method for masking --- .../org/wso2/carbon/identity/oauth/common/OAuthConstants.java | 1 - .../org/wso2/carbon/identity/oauth/OAuthAdminServiceImpl.java | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java b/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java index 525a6a63cb4..5eccad81687 100644 --- a/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java +++ b/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java @@ -550,7 +550,6 @@ public static class LogConstants { public static final String CREATE_OAUTH_APPLICATION = "CREATE OAUTH APPLICATION"; public static final String UPDATE_OAUTH_APPLICATION = "UPDATE OAUTH APPLICATION"; public static final String DELETE_OAUTH_APPLICATION = "DELETE OAUTH APPLICATION"; - public static final String DELETE_OAUTH_APPLICATIONS_IN_THE_GIVEN_ORG = "DELETE OAUTH APPLICATION IN GIVEN ORG"; public static final String REGENERATE_CLIENT_SECRET = "REGENERATE CLIENT SECRET"; public static final String UPDATE_APP_STATE = "UPDATE APP STATE"; } diff --git a/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/OAuthAdminServiceImpl.java b/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/OAuthAdminServiceImpl.java index 3dd64df8441..1981de0380d 100644 --- a/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/OAuthAdminServiceImpl.java +++ b/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/OAuthAdminServiceImpl.java @@ -448,8 +448,7 @@ private static void maskClientSecret(JSONObject oauthApp) { return; } String secret = oauthApp.get("oauthConsumerSecret").toString(); - String maskedSecret = secret.replaceAll(MASKING_REGEX, MASKING_CHARACTER); - oauthApp.put("oauthConsumerSecret", maskedSecret); + oauthApp.put("oauthConsumerSecret", LoggerUtils.getMaskedContent(secret)); } private void validateAudiences(OAuthConsumerAppDTO application) throws IdentityOAuthClientException {