diff --git a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/IdentityRecoveryConstants.java b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/IdentityRecoveryConstants.java index 01191ed205..6ed94fd9b6 100644 --- a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/IdentityRecoveryConstants.java +++ b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/IdentityRecoveryConstants.java @@ -88,6 +88,7 @@ public class IdentityRecoveryConstants { "http://wso2.org/claims/identity/failedLoginLockoutCount"; public static final String ACCOUNT_CONFIRMED_TIME_CLAIM = "http://wso2.org/claims/identity/accountConfirmedTime"; + public static final String FUNCTION_LOCKOUT_COUNT_PROPERTY = "LockoutCount"; public static final String FUNCTION_FAILED_ATTEMPTS_PROPERTY = "FailedAttempts"; public static final String FUNCTION_MAX_ATTEMPTS_PROPERTY = "MaxAttempts"; @@ -826,6 +827,10 @@ public static class Consent { public static final String PURPOSE_ID = "purposeId"; public static final String INFINITE_TERMINATION = "DATE_UNTIL:INDEFINITE"; public static final String RESIDENT_IDP = "Resident IDP"; + + //This is used for retrieve SP-UUID from the event. + //To-DO: onc ethe framework version bump to 7.3.14.x or above use the constant from framework insted of this. + public static final String SERVICE_PROVIDER_UUID = "serviceProviderUUID"; } /** diff --git a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/confirmation/ResendConfirmationManager.java b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/confirmation/ResendConfirmationManager.java index b070d80b58..187fcfbc2f 100644 --- a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/confirmation/ResendConfirmationManager.java +++ b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/confirmation/ResendConfirmationManager.java @@ -253,11 +253,12 @@ private void validateRequestAttributes(User recoveredUser, RecoveryScenarios sce private void triggerNotification(User user, String notificationChannel, String templateName, String code, String eventName, Property[] metaProperties) throws IdentityRecoveryException { - String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID); + String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID); HashMap properties = new HashMap<>(); if (!serviceProviderUUID.isBlank()) { - properties.put(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID, serviceProviderUUID); + properties.put(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID +, serviceProviderUUID); } properties.put(IdentityEventConstants.EventProperty.USER_NAME, user.getUserName()); properties.put(IdentityEventConstants.EventProperty.TENANT_DOMAIN, user.getTenantDomain()); diff --git a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserEmailVerificationHandler.java b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserEmailVerificationHandler.java index 96d6b3d668..018926fe6e 100644 --- a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserEmailVerificationHandler.java +++ b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserEmailVerificationHandler.java @@ -420,11 +420,12 @@ private void triggerNotification(User user, String type, String code, Property[] String eventName = IdentityEventConstants.Event.TRIGGER_NOTIFICATION; - String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID); + String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID); HashMap properties = new HashMap<>(); if (!serviceProviderUUID.isBlank()) { - properties.put(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID, serviceProviderUUID); + properties.put(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID +, serviceProviderUUID); } properties.put(IdentityEventConstants.EventProperty.USER_NAME, user.getUserName()); properties.put(IdentityEventConstants.EventProperty.TENANT_DOMAIN, user.getTenantDomain()); diff --git a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserSelfRegistrationHandler.java b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserSelfRegistrationHandler.java index dce33f1b6f..02b17cbc24 100644 --- a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserSelfRegistrationHandler.java +++ b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/handler/UserSelfRegistrationHandler.java @@ -428,11 +428,12 @@ private void triggerNotification(User user, String notificationChannel, String c log.debug("Sending self user registration notification user: " + user.getUserName()); } - String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID); + String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID); HashMap properties = new HashMap<>(); if (!serviceProviderUUID.isBlank()) { - properties.put(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID, serviceProviderUUID); + properties.put(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID +, serviceProviderUUID); } properties.put(IdentityEventConstants.EventProperty.USER_NAME, user.getUserName()); properties.put(IdentityEventConstants.EventProperty.TENANT_DOMAIN, user.getTenantDomain()); @@ -461,11 +462,12 @@ private void triggerNotification(User user, String notificationChannel, String c private void triggerAccountCreationNotification(User user) throws IdentityRecoveryServerException { String eventName = IdentityEventConstants.Event.TRIGGER_NOTIFICATION; - String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID); + String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID); HashMap properties = new HashMap<>(); if (!serviceProviderUUID.isBlank()) { - properties.put(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID, serviceProviderUUID); + properties.put(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID +, serviceProviderUUID); } properties.put(IdentityEventConstants.EventProperty.USER_NAME, user.getUserName()); properties.put(IdentityEventConstants.EventProperty.TENANT_DOMAIN, user.getTenantDomain()); diff --git a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/internal/service/impl/password/PasswordRecoveryManagerImpl.java b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/internal/service/impl/password/PasswordRecoveryManagerImpl.java index 35b5f683a5..e3304d0c56 100644 --- a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/internal/service/impl/password/PasswordRecoveryManagerImpl.java +++ b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/internal/service/impl/password/PasswordRecoveryManagerImpl.java @@ -26,7 +26,6 @@ import org.wso2.carbon.identity.base.IdentityConstants; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.identity.core.util.IdentityUtil; -import org.wso2.carbon.identity.event.IdentityEventConstants; import org.wso2.carbon.identity.event.IdentityEventException; import org.wso2.carbon.identity.governance.service.notification.NotificationChannels; import org.wso2.carbon.identity.recovery.IdentityRecoveryClientException; @@ -441,9 +440,10 @@ private NotificationResponseBean notifyUser(User user, String notificationChanne boolean manageNotificationInternally, Map properties) throws IdentityRecoveryException { - String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID); + String serviceProviderUUID = (String) IdentityUtil.threadLocalProperties.get().get(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID); if (!serviceProviderUUID.isBlank()) { - properties.put(IdentityEventConstants.EventProperty.SERVICE_PROVIDER_UUID, serviceProviderUUID); + properties.put(IdentityRecoveryConstants.Consent.SERVICE_PROVIDER_UUID +, serviceProviderUUID); } Property[] metaProperties = buildPropertyList(notificationChannel, properties); diff --git a/pom.xml b/pom.xml index a16e94dc95..5f9e008d09 100644 --- a/pom.xml +++ b/pom.xml @@ -695,7 +695,7 @@ [1.0.1, 2.0.0) - 5.25.707 + 5.25.623 [5.20.211, 8.0.0)