diff --git a/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/src/main/java/org/wso2/carbon/identity/notification/sender/tenant/config/NotificationSenderManagementServiceImpl.java b/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/src/main/java/org/wso2/carbon/identity/notification/sender/tenant/config/NotificationSenderManagementServiceImpl.java index 8c4a97f34..d89b2fc0e 100644 --- a/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/src/main/java/org/wso2/carbon/identity/notification/sender/tenant/config/NotificationSenderManagementServiceImpl.java +++ b/components/notification-sender-config/org.wso2.carbon.identity.notification.sender.tenant.config/src/main/java/org/wso2/carbon/identity/notification/sender/tenant/config/NotificationSenderManagementServiceImpl.java @@ -871,9 +871,16 @@ private EmailSenderDTO buildEmailSenderFromResource(Resource resource) throws } emailSender.getProperties().put(CLIENT_ID, value); break; - /* Client secret needs to be ignored as it is not supported with v1 and secrets are - not included in the v2 response. */ + /* Client secret will be dropped from the response from api level, However returning the secret is + required at this level to support the patch request. */ case CLIENT_SECRET: + try { + value = decryptCredential(EMAIL_PROVIDER, CLIENT_CREDENTIAL, CLIENT_SECRET); + } catch (SecretManagementException e) { + throw new NotificationSenderManagementServerException( + ERROR_CODE_ERROR_WHILE_DECRYPTING_CREDENTIALS, e.getMessage(), e); + } + emailSender.getProperties().put(CLIENT_SECRET, value); break; case AUTH_TYPE: emailSender.setAuthType(value);