From b96463815c72ea859e41d3b7f1552e364dab3ed8 Mon Sep 17 00:00:00 2001 From: Thisara-Welmilla Date: Tue, 19 Nov 2024 08:47:21 +0530 Subject: [PATCH] Address comments --- .../wso2/carbon/idp/mgt/IdentityProviderManager.java | 2 +- ...UserDefinedAuthenticatorEndpointConfigManager.java | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java index 1a23579e5202..9dbcdea2f0b1 100644 --- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java +++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java @@ -1503,8 +1503,8 @@ public IdentityProvider addIdPWithResourceId(IdentityProvider identityProvider, throws IdentityProviderManagementException { markConfidentialPropertiesUsingMetadata(identityProvider); - validateFederatedAuthenticatorConfigName(identityProvider.getFederatedAuthenticatorConfigs(), tenantDomain); validateAddIdPInputValues(identityProvider.getIdentityProviderName(), tenantDomain); + validateFederatedAuthenticatorConfigName(identityProvider.getFederatedAuthenticatorConfigs(), tenantDomain); validateOutboundProvisioningRoles(identityProvider, tenantDomain); // Invoking the pre listeners. diff --git a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/UserDefinedAuthenticatorEndpointConfigManager.java b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/UserDefinedAuthenticatorEndpointConfigManager.java index f53e03d3e65d..8b4ffd694f32 100644 --- a/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/UserDefinedAuthenticatorEndpointConfigManager.java +++ b/components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/UserDefinedAuthenticatorEndpointConfigManager.java @@ -141,15 +141,14 @@ public FederatedAuthenticatorConfig resolveEndpointConfig(FederatedAuthenticator private UserDefinedAuthenticatorEndpointConfig buildUserDefinedAuthenticatorEndpointConfig( EndpointConfig endpointConfig) { - UserDefinedAuthenticatorEndpointConfig.UserDefinedAuthenticatorEndpointConfigBuilder endpointConfigBuilder = - new UserDefinedAuthenticatorEndpointConfig.UserDefinedAuthenticatorEndpointConfigBuilder(); - endpointConfigBuilder.uri(endpointConfig.getUri()); - endpointConfigBuilder.authenticationType(endpointConfig.getAuthentication().getType().getName()); Map propMap = new HashMap<>(); endpointConfig.getAuthentication().getProperties() .forEach(prop -> propMap.put(prop.getName(), prop.getValue())); - endpointConfigBuilder.authenticationProperties(propMap); - return endpointConfigBuilder.build(); + return new UserDefinedAuthenticatorEndpointConfig.UserDefinedAuthenticatorEndpointConfigBuilder() + .uri(endpointConfig.getUri()) + .authenticationType(endpointConfig.getAuthentication().getType().getName()) + .authenticationProperties(propMap) + .build(); } /**